diff --git a/app/common/service/ApprovalRecordsService.php b/app/common/service/ApprovalRecordsService.php index 61c026e..2de3f44 100644 --- a/app/common/service/ApprovalRecordsService.php +++ b/app/common/service/ApprovalRecordsService.php @@ -56,7 +56,11 @@ class ApprovalRecordsService case 'todo': if ($p['scene'] === 'todo') { - if (!in_array(1, $request->user->role_ids)) { +// if (!in_array(1, $request->user->role_ids)) { +// $config['where']['approver_id'] = $request->user->uid; +// } + $roles_id = array_intersect([1,5,6], $request->user->role_ids); + if(count($roles_id) === 0){ $config['where']['approver_id'] = $request->user->uid; } $config['where']['status'] = 'pending'; diff --git a/app/crm/service/StockOrdersService.php b/app/crm/service/StockOrdersService.php index 492ffd3..d9408d7 100644 --- a/app/crm/service/StockOrdersService.php +++ b/app/crm/service/StockOrdersService.php @@ -2,6 +2,7 @@ namespace app\crm\service; +use app\common\model\User; use support\Request; use support\exception\BusinessException; @@ -34,7 +35,10 @@ class StockOrdersService extends \app\common\service\StockOrdersService $config['order']['id'] = 'desc'; - $config['where']['salesperson_id'] = $request->user->uid; + $roles_id = array_intersect([1,5,6], $request->user->role_ids); + if(count($roles_id) === 0){ + $config['where']['salesperson_id'] = $request->user->uid; + } break; case 'print': case 'approval':