浏览代码

shop fetch order

xiaoyu 3 年之前
父节点
当前提交
08077b87c3
共有 1 个文件被更改,包括 8 次插入8 次删除
  1. 8 8
      shop/control/store_refill_order.php

+ 8 - 8
shop/control/store_refill_order.php

@@ -30,13 +30,9 @@ class store_refill_ordercontrol extends BaseSellerControl
         $mod = Model('fetch_order');
 
         $member_id = $_SESSION['member_id'];
-        $condition['store_id'] = $_SESSION['store_id'];
-        $condition['fetch_status'] = 1;
-        $total_fetch_order = $mod->where($condition)->count();
-
-        $condition['member_id'] = $member_id;
-        $condition['fetch_status'] = 2;
-        $order_list = $mod->getFetchOrderList($condition,20);
+        $store_id = $_SESSION['store_id'];
+        $total_fetch_order = $mod->store_order_count($store_id);
+        $order_list = $mod->fetch_order_list($store_id,$member_id);
 
         Tpl::output('order_list', $order_list);
         Tpl::output('total_fetch_order', $total_fetch_order);
@@ -55,6 +51,10 @@ class store_refill_ordercontrol extends BaseSellerControl
         $mod = Model('fetch_order');
         $member_id = $_SESSION['member_id'];
         $store_id = $_SESSION['store_id'];
+        $fetch_count = $mod->member_order_count($store_id, $member_id);
+        if($fetch_count >= 10) {
+            showDialog('请先处理未处理的订单','index.php?act=store_refill_order&op=index','error');
+        }
         $res = $mod->fetch($store_id, $member_id, $card_type, $num);
         if(!empty($res)) {
             showDialog('抢单成功','index.php?act=store_refill_order&op=index','succ');
@@ -106,8 +106,8 @@ class store_refill_ordercontrol extends BaseSellerControl
                 'order_sn' => $fetch_order['order_sn'],
                 'official_sn' => $official_sn];
             Log::record("state: {$state_type}, order_sn: {$fetch_order['order_sn']}, official_sn: {$official_sn}", Log::DEBUG);
-            refill\util::push_notify($fetch_order['channel_name'],$params);
             $mod->processed($fetch_id,$state_type,$official_sn);
+            refill\util::push_notify($fetch_order['channel_name'],$params);
             showDialog("成功", 'reload', 'js');
             exit();
         }