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

bug

... ... @@ -20,6 +20,8 @@ use think\Session;
class OrderSalesmanController extends WeChatBaseController
{
protected $user_id;
protected $status;
protected $pid;
protected $beforeActionList = [
'check' => ['except' => 'getGradeClass'],
];
... ... @@ -31,9 +33,12 @@ class OrderSalesmanController extends WeChatBaseController
if(empty($my_user)){
$this->error('查无此人','','','');
}
if($my_user['status'] != 2){
$this->error('您还不是业务员那','','','');
$this->status = $my_user['status'];
$this->pid = $my_user['id'];
if($my_user['status'] != 2 && $my_user['status'] != 3){
$this->error('您还没有权限查看','','','');
}
$this->assign('my_user',$my_user);
}
public function get_all(){
$param = $this->request->param();
... ... @@ -41,7 +46,17 @@ class OrderSalesmanController extends WeChatBaseController
$where['is_courier'] = ['eq',$param['is_courier']];
}
$user_id = $this->user_id;
$where['salesman_uid'] = ['eq',$user_id];
if($this->status == 2){
$where['salesman_uid'] = ['eq',$user_id];
}else{
//获取当前用户的所有下级
$user_child = Db::name('my_user')->where(['pid'=>$this->pid])->select();
$user_ids = [];
foreach($user_child as $key => $u_c){
$user_ids[] = $u_c['uid'];
}
$where['uid'] = ['in',$user_ids];
}
$where['indent_type'] = ['eq',2];
$where['state'] = ['eq',2];
$indentModel = new IndentModel();
... ...
... ... @@ -225,6 +225,21 @@
</div>
</div>
</a>
<a href="{:url('OrderSalesman/get_all')}">
<div class="log_one_list_one">
<div class="log_one_list_left">
<div class="log_one_list_img">
<img src="__TMPL__/public/assets/images/dingdan.png" alt="" />
</div>
<div class="log_one_list_word">
订单管理
</div>
</div>
<div class="log_one_list_right">
<img src="__TMPL__/public/assets/images/29.png" alt="" />
</div>
</div>
</a>
</if>
</div>
<!-- 底部一级导航 -->
... ...
... ... @@ -204,13 +204,13 @@ class WeChatBaseController extends BaseController
*/
public function checkWeChatUserLogin()
{
// if(cmf_get_current_user_id()==3){
// $user = Db::name('user')->where('id',7)->find();
// cmf_update_current_user($user);
// }else if(cmf_get_current_user_id()==484){
// $user = Db::name('user')->where('id',9)->find();
// cmf_update_current_user($user);
// }
if(cmf_get_current_user_id()==3){
$user = Db::name('user')->where('id',484)->find();
cmf_update_current_user($user);
}else if(cmf_get_current_user_id()==484){
$user = Db::name('user')->where('id',9)->find();
cmf_update_current_user($user);
}
// session('user',null);
$userId = cmf_get_current_user_id();
if (empty($userId)) {
... ...