hrjy 3 年之前
父节点
当前提交
a42f82b828
共有 1 个文件被更改,包括 9 次插入4 次删除
  1. 9 4
      app/api/controller/user/UserBillController.php

+ 9 - 4
app/api/controller/user/UserBillController.php

@@ -100,10 +100,15 @@ class UserBillController
                 $js = StoreOrderIncrement::where('uid', 'in', $userUid)->count();
                 $js = StoreOrderIncrement::where('uid', 'in', $userUid)->count();
                 $data['order'] = (StoreOrder::where('uid', 'in', $userUid)->where('pay_type', 'weixin')->where('status', '>=', 0)->where('paid', 1)->count() + $zz) - $js;
                 $data['order'] = (StoreOrder::where('uid', 'in', $userUid)->where('pay_type', 'weixin')->where('status', '>=', 0)->where('paid', 1)->count() + $zz) - $js;
                 $zt_uid = User::where('spread_uid', $uid)->column('uid');
                 $zt_uid = User::where('spread_uid', $uid)->column('uid');
-                $zzs = StoreOrderIncrement::where('increment_uid', 'in', $zt_uid)->count();
-                $jss = StoreOrderIncrement::where('uid', 'in', $zt_uid)->count();
-                $data['zt_order'] = (StoreOrder::where('uid', $zt_uid)->where('pay_type', 'weixin')->where('status', '>=', 0)->where('paid', 1)->count() + $zzs) - $jss;
-                $data['jt_order'] = $data['order'] - $data['zt_order'];
+                if ($zt_uid){
+                    $zzs = StoreOrderIncrement::where('increment_uid', 'in', $zt_uid)->count();
+                    $jss = StoreOrderIncrement::where('uid', 'in', $zt_uid)->count();
+                    $data['zt_order'] = (StoreOrder::where('uid', 'in',$zt_uid)->where('pay_type', 'weixin')->where('status', '>=', 0)->where('paid', 1)->count() + $zzs) - $jss;
+                    $data['jt_order'] = $data['order'] - $data['zt_order'];
+                }else{
+                    $data['zt_order'] = 0;
+                    $data['jt_order'] = $data['order'];
+                }
             }else{
             }else{
                 $data['order'] = 0;
                 $data['order'] = 0;
             }
             }