...
|
...
|
@@ -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();
|
...
|
...
|
|