...
|
...
|
@@ -20,6 +20,7 @@ use think\Session; |
|
|
class OrderSalesmanController extends WeChatBaseController
|
|
|
{
|
|
|
protected $user_id;
|
|
|
protected $my_user;
|
|
|
protected $status;
|
|
|
protected $pid;
|
|
|
protected $beforeActionList = [
|
...
|
...
|
@@ -29,16 +30,16 @@ class OrderSalesmanController extends WeChatBaseController |
|
|
protected function check() {
|
|
|
$user_id = cmf_get_current_user_id();
|
|
|
$this->user_id = $user_id;
|
|
|
$my_user = Db::name('my_user')->where(['uid'=>$user_id])->find();
|
|
|
if(empty($my_user)){
|
|
|
$this->my_user = Db::name('my_user')->where(['uid'=>$user_id])->find();
|
|
|
if(empty($this->my_user)){
|
|
|
$this->error('查无此人','','','');
|
|
|
}
|
|
|
$this->status = $my_user['status'];
|
|
|
$this->pid = $my_user['id'];
|
|
|
if($my_user['status'] != 2 && $my_user['status'] != 3){
|
|
|
$this->status = $this->my_user['status'];
|
|
|
$this->pid = $this->my_user['id'];
|
|
|
if($this->my_user['status'] != 2 && $this->my_user['status'] != 3){
|
|
|
$this->error('您还没有权限查看','','','');
|
|
|
}
|
|
|
$this->assign('my_user',$my_user);
|
|
|
$this->assign('my_user',$this->my_user);
|
|
|
}
|
|
|
public function get_all(){
|
|
|
$param = $this->request->param();
|
...
|
...
|
@@ -78,7 +79,12 @@ class OrderSalesmanController extends WeChatBaseController |
|
|
$goods_count[$key]['number_sum'] = $number_sum;
|
|
|
}
|
|
|
$this->assign('goods_count',$goods_count);
|
|
|
$school = Db::name('school')->where('uid',$user_id)->order('create_time desc')->select()->toArray();
|
|
|
// 身份为老师,获取上级业务员的id
|
|
|
$school_uid = $user_id;
|
|
|
if($this->my_user['status'] == 3) {
|
|
|
$school_uid = Db::name('my_user')->where('id',$this->my_user['pid'])->value('uid');
|
|
|
}
|
|
|
$school = Db::name('school')->where('uid',$school_uid)->order('create_time desc')->select()->toArray();
|
|
|
if(count($school)!=0){
|
|
|
$schools = [];
|
|
|
foreach ($school as $key => $val){
|
...
|
...
|
@@ -133,7 +139,12 @@ class OrderSalesmanController extends WeChatBaseController |
|
|
// $where['is_courier'] = ['eq',1];
|
|
|
// }//
|
|
|
$user_id = $this->user_id;
|
|
|
$where['salesman_uid'] = ['eq',$user_id];
|
|
|
// 身份为老师,获取上级业务员的id
|
|
|
$school_uid = $user_id;
|
|
|
if($this->my_user['status'] == 3) {
|
|
|
$school_uid = Db::name('my_user')->where('id',$this->my_user['pid'])->value('uid');
|
|
|
}
|
|
|
$where['salesman_uid'] = ['eq',$school_uid];
|
|
|
$where['indent_type'] = ['eq',2];
|
|
|
$indentModel = new IndentModel();
|
|
|
$data = $indentModel->selectData($where);
|
...
|
...
|
|