作者 刘朕
1 个管道 的构建 通过 耗费 1 秒

教室查看订单筛选修改

... ... @@ -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);
... ...
... ... @@ -367,7 +367,7 @@
</div>
</div>-->
<if condition="$my_user['status'] eq 2">
<if condition="in_array($my_user['status'],[2,3])">
<div class="log_three_select_one log_three_select_school2">
<div class="log_three_select_title schools_word">
请选择学校
... ... @@ -739,7 +739,7 @@
function zujian(data_class_arr) {
(function ($, doc) {
$.init();
school_arr = "{$school}";
school_arr = {$school};
$.ready(function () {
schoolpicker.setData(school_arr);
classpicker.setData(data_class_arr);
... ...