分类
PHP

App信息提醒与提示音

<!--第一层级待结单(绑定奖励抢单)-->
{php $old_record_id = $_COOKIE['record_id'];}

{list action=sql sql='select max(id) as record_id from imt_1_order_uid_record where uid=$member.uid and dispatch_degree<5' cache=0 return=s}
{php $new_record_id=$s.record_id;}
{/list}

{php setcookie("record_id", $new_record_id);}

{list action=sql sql='select distinct id,oid from imt_1_order_uid_record where uid=$member.uid and dispatch_degree<5 order by dispatch_degree asc' cache=0 return=f}
{if $f.id>$old_record_id}
{php $ordersLevel[]=$f;}
{/if}
{/list}

{if $ordersLevel}
{loop $ordersLevel $order}
{if dr_imt_1_order($order['oid'])[0]['dispatch_degree']<5 && $member['state']==0 && dr_imt_1_order($order['oid'])[0]['order_status'] !=9}
<?php $buy_uid = dr_imt_1_order($order['oid'])[0]['buy_uid'];?>
<?php $heimingdan = dr_imt_member_data($buy_uid)[0]['heimingdan'];?>

{if $heimingdan}
<?php $heimingdan_array = explode(',',$heimingdan);?>
{else}
<?php $heimingdan_array = array(0);?>
{/if}

{if !in_array($member['uid'],$heimingdan_array)}
    {if dr_imt_1_order($order['oid'])[0]['new_order_type']==0}
        {php $goods = dr_imt_1_order_goods($order['oid']);}
        {php $goods_ids = array_column($goods,'cid');}
        {php $rewards = dr_rewards_goods($goods_ids);}
        {if dr_imt_1_order($order['oid'])[0]['dispatch_degree']==1}
        {php $daijiedan[] = 1;}
        {else if in_array(0, $rewards)}
        {php $daijiedan[] = 10;}
        {else}
        {php $daijiedan[] = dr_imt_1_order($order['oid'])[0]['dispatch_degree'];}
        {/if}
    {/if}
{/if}

{/if}
{/loop}
{/if}

{if $member['groupid']==5}

<!--派单员才能刷新-->
<!--新的订单才刷新-->

{if in_array(1, $daijiedan)}

<script>
    apiready = function(){
        var audio = api.require('audio');
        audio.play({
            path: '{dr_get_file(dr_block('bangding'))}'
        }, function(ret, err) {});
        api.notification({
            notify: {
            title: '订单提示',
                content: '您有新的绑定订单,请及时进行处理!'
            }
        });
    }
</script>

{else if in_array(10,$daijiedan)}

<script>
    apiready = function(){
        var audio = api.require('audio');
        audio.play({
            path: '{dr_get_file(dr_block('rewards'))}'
        }, function(ret, err) {});
        api.notification({
            notify: {
            title: '订单提示',
                content: '您有新的奖励订单,请及时进行处理!'
            }
        });
    }
</script>

{else if in_array(2,$daijiedan) || in_array(3,$daijiedan) ||in_array(4,$daijiedan)}
<script>
    apiready = function(){
        var audio = api.require('audio');
        audio.play({
            path: '{dr_get_file(dr_block('qiangdan'))}'
        }, function(ret, err) {});
        api.notification({
            notify: {
            title: '订单提示',
                content: '您有新的订单,请及时进行处理!'
            }
        });
    }
</script>
{/if}

{/if}


<!--第二层级超时订单(超时订单)-->

{list action=module module=order field=id cache=0 delivery_clerk_id=$member.uid}
    {if $t.delivery_clerk_done_time==0 && $t.order_status!=9}
        {if time()-$t.delivery_clerk_accept_time>0 }
        {php $g[] = $t;}
        {/if}
    {/if}
{/list}

{php $chaoshi_order_ids = array_column($g,id);}
{php $old_chaoshi_order_ids = json_decode($_COOKIE['chaoshi']);}
{php $new_chaoshi_order_ids = $chaoshi_order_ids;}
{php setcookie("chaoshi", json_encode($new_chaoshi_order_ids));}
{php $diff_chaoshi = array_diff($new_chaoshi_order_ids,$old_chaoshi_order_ids);}

{if $diff_chaoshi}
<script>
    apiready = function(){
        var audio = api.require('audio');
        audio.play({
            path: '{dr_get_file(dr_block('timeout'))}'
        }, function(ret, err) {});
        api.notification({
            notify: {
            title: '订单提示',
                content: '您有订单配送超时,请及时进行处理!'
            }
        });
    }
</script>
{/if}


<!--第三层级指派订单(指派订单)-->

{list action=module module=order field=id dispatch_type=5 cache=0 delivery_clerk_id=$member.uid}
    {if $t.delivery_clerk_done_time==0 && $t.order_status!=9}
        {php $k[] = $t;}
    {/if}
{/list}

{if $k}
    {php $zhipai_order_ids = array_column($k,id);}
    {php $old_zhipai_order_ids = json_decode($_COOKIE['zhipai']);}
    {php $new_zhipai_order_ids = $chaoshi_order_ids;}
    {php setcookie("zhipai", json_encode($new_zhipai_order_ids));}
    {php $diff_zhipai = array_diff($new_zhipai_order_ids,$old_zhipai_order_ids);}
    
    {if $diff_zhipai}
    <script>
        apiready = function(){
            var audio = api.require('audio');
            audio.play({
                path: '{dr_get_file(dr_block('dispatch'))}'
            }, function(ret, err) {});
            api.notification({
                notify: {
                title: '订单提示',
                    content: '您有新的指派订单,请及时进行处理!'
                }
            });
        }
    </script>
    {/if}
{/if}


<!--第四层级指派订单(取消订单)-->
{list action=module module=order field=id order_status=9 cache=0 delivery_clerk_id=$member.uid}
    {php $p[] = $t;}
{/list}

{php $quxiao_order_ids = array_column($p,id);}
{php $old_quxiao_order_ids = json_decode($_COOKIE['quxiao']);}
{php $new_quxiao_order_ids = $quxiao_order_ids;}
{php setcookie("quxiao", json_encode($new_quxiao_order_ids));}
{php $diff_quxiao = array_diff($new_quxiao_order_ids,$old_quxiao_order_ids);}

{if $diff_quxiao}
<script>
    apiready = function(){
        var audio = api.require('audio');
        audio.play({
            path: '{dr_get_file(dr_block('cancel'))}'
        }, function(ret, err) {});
        api.notification({
            notify: {
            title: '订单提示',
                content: '您派送的订单中有取消单,请及时进行处理!'
            }
        });
    }
</script>
{/if}

 

<!--第一层级待结单(绑定奖励抢单)-->
{php $old_record_id = $_COOKIE['record_id'];}

{list action=sql sql='select max(id) as record_id from imt_1_order_uid_record where uid=$member.uid and dispatch_degree<5' cache=0 return=s}
{php $new_record_id=$s.record_id;}
{/list}

{php setcookie("record_id", $new_record_id);}

{list action=sql sql='select distinct id,oid from imt_1_order_uid_record where uid=$member.uid and dispatch_degree<5 order by dispatch_degree asc' cache=0 return=f}
{if $f.id>$old_record_id}
{php $ordersLevel[]=$f;}
{/if}
{/list}

{if $ordersLevel}
{loop $ordersLevel $order}
{if dr_imt_1_order($order['oid'])[0]['dispatch_degree']<5 && $member['state']==0 && dr_imt_1_order($order['oid'])[0]['order_status'] !=9}
<?php $buy_uid = dr_imt_1_order($order['oid'])[0]['buy_uid'];?>
<?php $heimingdan = dr_imt_member_data($buy_uid)[0]['heimingdan'];?>

{if $heimingdan}
<?php $heimingdan_array = explode(',',$heimingdan);?>
{else}
<?php $heimingdan_array = array(0);?>
{/if}

{if !in_array($member['uid'],$heimingdan_array)}
    {if dr_imt_1_order($order['oid'])[0]['new_order_type']==0}
        {php $goods = dr_imt_1_order_goods($order['oid']);}
        {php $goods_ids = array_column($goods,'cid');}
        {php $rewards = dr_rewards_goods($goods_ids);}
        {if dr_imt_1_order($order['oid'])[0]['dispatch_degree']==1}
        {php $daijiedan[] = 1;}
        {else if in_array(0, $rewards)}
        {php $daijiedan[] = 10;}
        {else}
        {php $daijiedan[] = dr_imt_1_order($order['oid'])[0]['dispatch_degree'];}
        {/if}
    {/if}
{/if}

{/if}
{/loop}
{/if}

{if $member['groupid']==5}

<!--派单员才能刷新-->
<!--新的订单才刷新-->

{if in_array(1, $daijiedan)}

<script>
    apiready = function(){
        var audio = api.require('audio');
        audio.play({
            path: '{dr_get_file(dr_block('bangding'))}'
        }, function(ret, err) {});
        api.notification({
            notify: {
            title: '订单提示',
                content: '您有新的绑定订单,请及时进行处理!'
            }
        });
    }
</script>

{else if in_array(10,$daijiedan)}

<script>
    apiready = function(){
        var audio = api.require('audio');
        audio.play({
            path: '{dr_get_file(dr_block('rewards'))}'
        }, function(ret, err) {});
        api.notification({
            notify: {
            title: '订单提示',
                content: '您有新的奖励订单,请及时进行处理!'
            }
        });
    }
</script>

{else if in_array(2,$daijiedan) || in_array(3,$daijiedan) ||in_array(4,$daijiedan)}
<script>
    apiready = function(){
        var audio = api.require('audio');
        audio.play({
            path: '{dr_get_file(dr_block('qiangdan'))}'
        }, function(ret, err) {});
        api.notification({
            notify: {
            title: '订单提示',
                content: '您有新的订单,请及时进行处理!'
            }
        });
    }
</script>
{/if}

{/if}


<!--第二层级超时订单(超时订单)-->

{list action=module module=order field=id cache=0 delivery_clerk_id=$member.uid}
    {if $t.delivery_clerk_done_time==0 && $t.order_status!=9}
        {if time()-$t.delivery_clerk_accept_time>0 }
        {php $g[] = $t;}
        {/if}
    {/if}
{/list}

{php $chaoshi_order_ids = array_column($g,id);}
{php $old_chaoshi_order_ids = json_decode($_COOKIE['chaoshi']);}
{php $new_chaoshi_order_ids = $chaoshi_order_ids;}
{php setcookie("chaoshi", json_encode($new_chaoshi_order_ids));}
{php $diff_chaoshi = array_diff($new_chaoshi_order_ids,$old_chaoshi_order_ids);}

{if $diff_chaoshi}
<script>
    apiready = function(){
        var audio = api.require('audio');
        audio.play({
            path: '{dr_get_file(dr_block('timeout'))}'
        }, function(ret, err) {});
        api.notification({
            notify: {
            title: '订单提示',
                content: '您有订单配送超时,请及时进行处理!'
            }
        });
    }
</script>
{/if}


<!--第三层级指派订单(指派订单)-->

{list action=module module=order field=id dispatch_type=5 cache=0 delivery_clerk_id=$member.uid}
    {if $t.delivery_clerk_done_time==0 && $t.order_status!=9}
        {php $k[] = $t;}
    {/if}
{/list}

{if $k}
    {php $zhipai_order_ids = array_column($k,id);}
    {php $old_zhipai_order_ids = json_decode($_COOKIE['zhipai']);}
    {php $new_zhipai_order_ids = $chaoshi_order_ids;}
    {php setcookie("zhipai", json_encode($new_zhipai_order_ids));}
    {php $diff_zhipai = array_diff($new_zhipai_order_ids,$old_zhipai_order_ids);}
    
    {if $diff_zhipai}
    <script>
        apiready = function(){
            var audio = api.require('audio');
            audio.play({
                path: '{dr_get_file(dr_block('dispatch'))}'
            }, function(ret, err) {});
            api.notification({
                notify: {
                title: '订单提示',
                    content: '您有新的指派订单,请及时进行处理!'
                }
            });
        }
    </script>
    {/if}
{/if}


<!--第四层级指派订单(取消订单)-->
{list action=module module=order field=id order_status=9 cache=0 delivery_clerk_id=$member.uid}
    {php $p[] = $t;}
{/list}

{php $quxiao_order_ids = array_column($p,id);}
{php $old_quxiao_order_ids = json_decode($_COOKIE['quxiao']);}
{php $new_quxiao_order_ids = $quxiao_order_ids;}
{php setcookie("quxiao", json_encode($new_quxiao_order_ids));}
{php $diff_quxiao = array_diff($new_quxiao_order_ids,$old_quxiao_order_ids);}

{if $diff_quxiao}
<script>
    apiready = function(){
        var audio = api.require('audio');
        audio.play({
            path: '{dr_get_file(dr_block('cancel'))}'
        }, function(ret, err) {});
        api.notification({
            notify: {
            title: '订单提示',
                content: '您派送的订单中有取消单,请及时进行处理!'
            }
        });
    }
</script>
{/if}

发表评论

电子邮件地址不会被公开。 必填项已用*标注