作者 王晓刚
1 个管道 的构建 通过 耗费 23 秒

bug

@@ -20,6 +20,8 @@ use think\Session; @@ -20,6 +20,8 @@ use think\Session;
20 class OrderSalesmanController extends WeChatBaseController 20 class OrderSalesmanController extends WeChatBaseController
21 { 21 {
22 protected $user_id; 22 protected $user_id;
  23 + protected $status;
  24 + protected $pid;
23 protected $beforeActionList = [ 25 protected $beforeActionList = [
24 'check' => ['except' => 'getGradeClass'], 26 'check' => ['except' => 'getGradeClass'],
25 ]; 27 ];
@@ -31,9 +33,12 @@ class OrderSalesmanController extends WeChatBaseController @@ -31,9 +33,12 @@ class OrderSalesmanController extends WeChatBaseController
31 if(empty($my_user)){ 33 if(empty($my_user)){
32 $this->error('查无此人','','',''); 34 $this->error('查无此人','','','');
33 } 35 }
34 - if($my_user['status'] != 2){  
35 - $this->error('您还不是业务员那','','',''); 36 + $this->status = $my_user['status'];
  37 + $this->pid = $my_user['id'];
  38 + if($my_user['status'] != 2 && $my_user['status'] != 3){
  39 + $this->error('您还没有权限查看','','','');
36 } 40 }
  41 + $this->assign('my_user',$my_user);
37 } 42 }
38 public function get_all(){ 43 public function get_all(){
39 $param = $this->request->param(); 44 $param = $this->request->param();
@@ -41,7 +46,17 @@ class OrderSalesmanController extends WeChatBaseController @@ -41,7 +46,17 @@ class OrderSalesmanController extends WeChatBaseController
41 $where['is_courier'] = ['eq',$param['is_courier']]; 46 $where['is_courier'] = ['eq',$param['is_courier']];
42 } 47 }
43 $user_id = $this->user_id; 48 $user_id = $this->user_id;
  49 + if($this->status == 2){
44 $where['salesman_uid'] = ['eq',$user_id]; 50 $where['salesman_uid'] = ['eq',$user_id];
  51 + }else{
  52 + //获取当前用户的所有下级
  53 + $user_child = Db::name('my_user')->where(['pid'=>$this->pid])->select();
  54 + $user_ids = [];
  55 + foreach($user_child as $key => $u_c){
  56 + $user_ids[] = $u_c['uid'];
  57 + }
  58 + $where['uid'] = ['in',$user_ids];
  59 + }
45 $where['indent_type'] = ['eq',2]; 60 $where['indent_type'] = ['eq',2];
46 $where['state'] = ['eq',2]; 61 $where['state'] = ['eq',2];
47 $indentModel = new IndentModel(); 62 $indentModel = new IndentModel();
@@ -225,6 +225,21 @@ @@ -225,6 +225,21 @@
225 </div> 225 </div>
226 </div> 226 </div>
227 </a> 227 </a>
  228 + <a href="{:url('OrderSalesman/get_all')}">
  229 + <div class="log_one_list_one">
  230 + <div class="log_one_list_left">
  231 + <div class="log_one_list_img">
  232 + <img src="__TMPL__/public/assets/images/dingdan.png" alt="" />
  233 + </div>
  234 + <div class="log_one_list_word">
  235 + 订单管理
  236 + </div>
  237 + </div>
  238 + <div class="log_one_list_right">
  239 + <img src="__TMPL__/public/assets/images/29.png" alt="" />
  240 + </div>
  241 + </div>
  242 + </a>
228 </if> 243 </if>
229 </div> 244 </div>
230 <!-- 底部一级导航 --> 245 <!-- 底部一级导航 -->
@@ -204,13 +204,13 @@ class WeChatBaseController extends BaseController @@ -204,13 +204,13 @@ class WeChatBaseController extends BaseController
204 */ 204 */
205 public function checkWeChatUserLogin() 205 public function checkWeChatUserLogin()
206 { 206 {
207 -// if(cmf_get_current_user_id()==3){  
208 -// $user = Db::name('user')->where('id',7)->find();  
209 -// cmf_update_current_user($user);  
210 -// }else if(cmf_get_current_user_id()==484){  
211 -// $user = Db::name('user')->where('id',9)->find();  
212 -// cmf_update_current_user($user);  
213 -// } 207 + if(cmf_get_current_user_id()==3){
  208 + $user = Db::name('user')->where('id',484)->find();
  209 + cmf_update_current_user($user);
  210 + }else if(cmf_get_current_user_id()==484){
  211 + $user = Db::name('user')->where('id',9)->find();
  212 + cmf_update_current_user($user);
  213 + }
214 // session('user',null); 214 // session('user',null);
215 $userId = cmf_get_current_user_id(); 215 $userId = cmf_get_current_user_id();
216 if (empty($userId)) { 216 if (empty($userId)) {