作者 郭文星

'123'

@@ -394,7 +394,7 @@ class Business extends Base @@ -394,7 +394,7 @@ class Business extends Base
394 $r1 = Db::name('_verification_staff')->where(['user_id'=>$user_id,'type'=>'0','verification_store_id'=>$store_id])->find(); 394 $r1 = Db::name('_verification_staff')->where(['user_id'=>$user_id,'type'=>'0','verification_store_id'=>$store_id])->find();
395 if(empty($r1)){ return $this->error('仅店长可查自己店铺信息'); } 395 if(empty($r1)){ return $this->error('仅店长可查自己店铺信息'); }
396 //当前店铺下的代理人,及代理人的推广数量 396 //当前店铺下的代理人,及代理人的推广数量
397 - $rows = Db::name('_verification_staff')->where(['verification_store_id'=>$store_id,'type'=>['in',['1','3']]])->field("name,0 as count,user_id")->paginate(20)->each(function($item){ 397 + $rows = Db::name('_verification_staff')->where(['verification_store_id'=>$store_id,'type'=>['in',['0','1','3']]])->field("name,0 as count,user_id")->paginate(20)->each(function($item){
398 $item['count'] = Db::name('user')->where(['pid'=>$item['user_id']])->count(); 398 $item['count'] = Db::name('user')->where(['pid'=>$item['user_id']])->count();
399 return $item; 399 return $item;
400 })->toArray(); 400 })->toArray();
@@ -429,7 +429,7 @@ class Business extends Base @@ -429,7 +429,7 @@ class Business extends Base
429 $r1 = Db::name('_verification_staff')->where(['user_id'=>$user_id,'type'=>'0','verification_store_id'=>$store_id])->find(); 429 $r1 = Db::name('_verification_staff')->where(['user_id'=>$user_id,'type'=>'0','verification_store_id'=>$store_id])->find();
430 if(empty($r1)){ return $this->error('仅店长可查自己店铺信息'); } 430 if(empty($r1)){ return $this->error('仅店长可查自己店铺信息'); }
431 //当前店铺下的代理人,及代理人的推广数量 431 //当前店铺下的代理人,及代理人的推广数量
432 - $rows = Db::name('_verification_staff')->where(['verification_store_id'=>$store_id,'type'=>['in',['1','3']]])->field("name,0 as count,user_id")->paginate(20)->each(function($item) use ($dates){ 432 + $rows = Db::name('_verification_staff')->where(['verification_store_id'=>$store_id,'type'=>['in',['0','1','3']]])->field("name,0 as count,user_id")->paginate(20)->each(function($item) use ($dates){
433 //一级统计 433 //一级统计
434 $count_1 = Db::name('user')->where(['pid'=>$item['user_id'],'updatetime'=>['between',$dates]])->field("id")->select(); 434 $count_1 = Db::name('user')->where(['pid'=>$item['user_id'],'updatetime'=>['between',$dates]])->field("id")->select();
435 $item['count_1'] = count($count_1); 435 $item['count_1'] = count($count_1);