hrjy 2 năm trước cách đây
mục cha
commit
378bf76741

+ 1 - 1
app/admin/model/system/SystemStore.php

@@ -127,7 +127,7 @@ class SystemStore extends BaseModel
                     }
                 }
             }
-            $item['count'] = StoreOrder::where('uid', 'in',$userUid)->where('paid', 1)->count();
+            $item['count'] = StoreOrder::where('uid', 'in',$userUid)->where('pay_type', 'weixin')->where('status', '>=', 0)->where('paid', 1)->count();
         }
 
         return compact('count', 'data');

+ 6 - 6
app/admin/model/system/SystemStoreStaff.php

@@ -45,19 +45,19 @@ class SystemStoreStaff extends BaseModel
      */
     public static function lst($where)
     {
-        $model = self::page((int)$where['page'], (int)$where['limit']);
+        $model = self::alias('a')
+            ->join('wechat_user u', 'u.uid=a.uid')
+            ->join('system_store s', 'a.store_id = s.id')
+            ->field('a.id,u.nickname,a.avatar,a.staff_name,a.status,a.add_time,s.name');
         if (isset($where['store_id']) && $where['store_id'] != '') {
             $model = $model->where('store_id', $where['store_id']);
         }
 //        if (isset($where['type']) && $where['type'] != '' && ($data = self::setData($where['type']))) {
 //            $model = $model->where($data);
 //        }
-        $model = $model->alias('a')
-            ->join('wechat_user u', 'u.uid=a.uid')
-            ->join('system_store s', 'a.store_id = s.id')
-            ->field('a.id,u.nickname,a.avatar,a.staff_name,a.status,a.add_time,s.name');
+        $count = $model->count();
+        $model = $model->page((int)$where['page'], (int)$where['limit']);
         $data = $model->select();
-        $count = $data->count();
         return compact('count', 'data');
     }
 

+ 6 - 3
app/common.php

@@ -12,6 +12,8 @@
 // 应用公共文件
 
 
+use app\models\system\SystemStoreStaff;
+
 if (!function_exists('exception')) {
     /**
      * 抛出异常处理
@@ -660,9 +662,10 @@ if (!function_exists('get_downline')){
         foreach ($members as $key => $v) {
 
             if($v['spread_uid']==$id){  //pid为0的是顶级分类
-
-                $arr[]=$v['uid'];
-                $arr = array_merge($arr,get_downline($members,$v['uid']));
+                if (!SystemStoreStaff::where('uid', $v['uid'])->find()){
+                    $arr[]=$v['uid'];
+                    $arr = array_merge($arr,get_downline($members,$v['uid']));
+                }
             }
         }
         return $arr;