diff --git a/application/admin/controller/Ajax.php b/application/admin/controller/Ajax.php index 367d1bc..25f1ddb 100755 --- a/application/admin/controller/Ajax.php +++ b/application/admin/controller/Ajax.php @@ -334,7 +334,8 @@ class Ajax extends Backend $group = \model('auth_group_access')->where('uid',$this->auth->id)->find()->group_id ?? 0; - if ($group == 2 || $group == 6) { + $to_dispatch = 0; + if ($group == 6) { // 生成 SQL 语句 $ids = $user->area_ids??''; if ($ids == ''){ @@ -350,7 +351,10 @@ class Ajax extends Backend }); $to_dispatch = $order->where('status',\app\admin\model\Order::STATUS_DISPATCHING)->count(); } - }else{ + }else if($group == 2){ + $order->where('admin_id',$user->id); + $to_dispatch = $order->where('status',\app\admin\model\Order::STATUS_DISPATCHING)->count(); + }else if($group == 1){ $to_dispatch = $order->where('status',\app\admin\model\Order::STATUS_DISPATCHING)->count(); } //待跟进 diff --git a/application/admin/controller/Index.php b/application/admin/controller/Index.php index f9d7f7d..a6b2aff 100755 --- a/application/admin/controller/Index.php +++ b/application/admin/controller/Index.php @@ -46,7 +46,8 @@ class Index extends Backend $group = \model('auth_group_access')->where('uid',$this->auth->id)->find()->group_id ?? 0; - if ($group == 2 || $group == 6) { + $to_dispatch = 0; + if ($group == 6) { // 生成 SQL 语句 $ids = $user->area_ids??''; if ($ids == ''){ @@ -62,7 +63,10 @@ class Index extends Backend }); $to_dispatch = $order->where('status',\app\admin\model\Order::STATUS_DISPATCHING)->count(); } - }else{ + }else if($group == 2){ + $order->where('admin_id',$user->id); + $to_dispatch = $order->where('status',\app\admin\model\Order::STATUS_DISPATCHING)->count(); + }else if($group == 1){ $to_dispatch = $order->where('status',\app\admin\model\Order::STATUS_DISPATCHING)->count(); } //待跟进 diff --git a/application/admin/controller/Order.php b/application/admin/controller/Order.php index 55b692c..dc96052 100644 --- a/application/admin/controller/Order.php +++ b/application/admin/controller/Order.php @@ -132,6 +132,20 @@ class Order extends Backend $group = \model('auth_group_access')->where('uid', $this->auth->id)->find()->group_id ?? 0; $user = \model('admin')->find($this->auth->id); + $this->assignconfig('permissions', [ + 'add' => $this->auth->check('order/add'), + 'edit' => $this->auth->check('order/edit'), + 'copy' => $this->auth->check('order/copy'), + 'reminder' => $this->auth->check('order/reminder'), + 'warning' => $this->auth->check('order/warning'), + 'addAbnormal' => $this->auth->check('order/addAbnormal'), + 'delete' => $this->auth->check('order/delete'), + 'invoice' => $this->auth->check('order/invoice'), + 'aftersale' => $this->auth->check('aftersales/aftersale/add'), + 'log' => $this->auth->check('order/log'), + 'dispatch' => $this->auth->check('orders/dispatch/add'), + ]); + if (false === $this->request->isAjax()) { return $this->view->fetch(); @@ -197,7 +211,9 @@ class Order extends Backend ->where('create_time', '<=', (new Carbon())->subMinutes(20) ->format('Y-m-d H:i:s')); } - if ($group == 2 || $group == 6) { + if ($group == 2 ) { + $build->where('admin_id',$user->id); + }elseif ($group == 6){ // 生成 SQL 语句 $ids = $user->area_ids ?? ''; if ($ids == '') { @@ -211,8 +227,6 @@ class Order extends Backend $q->whereOr('area_id', 'like', $area_code . '%'); } }); - - } $list = $build diff --git a/application/admin/view/order/index.html b/application/admin/view/order/index.html index af0ab3f..ea35e55 100644 --- a/application/admin/view/order/index.html +++ b/application/admin/view/order/index.html @@ -4,10 +4,17 @@
{:build_heading(null,FALSE)} +
@@ -140,7 +147,7 @@