Commit c8c15c00 by 杨树贤

审核数量问题

parent c488e216
......@@ -136,17 +136,17 @@ class SupplierFilter
//默认过滤带有-1字符串的供应商名称的数据
$query->whereRaw('supplier_name NOT LIKE "%-1"');
if (config('website.domain') == 'liexin.net' && !in_array(request()->user->userId, [
1611,
1499,
1354,
1613,
1000,
1619,
1629
])) {
$query->where('supplier_channel.supplier_id', '>', 12211);
}
// if (config('website.domain') == 'liexin.net' && !in_array(request()->user->userId, [
// 1611,
// 1499,
// 1354,
// 1613,
// 1000,
// 1619,
// 1629
// ])) {
// $query->where('supplier_channel.supplier_id', '>', 12211);
// }
return $query;
}
......
......@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Sync;
use App\Http\Controllers\Controller;
use App\Http\Controllers\Filter\SupplierFilter;
use App\Http\Middleware\CheckLogin;
use App\Http\Services\AdminUserService;
use App\Http\Services\SupplierService;
use App\Http\Services\SyncSupplierService;
......@@ -53,20 +54,23 @@ class SupplierSyncController extends BaseSyncController
{
$userId = $request->input('user_id');
if (!$userId) {
$this->response(-1,'user_id不能为空');
$this->response(-1, 'user_id不能为空');
}
$codeId = (new AdminUserService())->getCodeIdsByUserId($userId);
request()->merge(['user'=>(object)[
'userId' => $userId,
'codeId' => $codeId,
]]);
// request()->user->userId = $userId;
// request()->user->codeId = $codeId;
request()->merge([
'user' => (object)[
'userId' => $userId,
'codeId' => $codeId,
]
]);
$perms = (new CheckLogin())->getPerms();
request()->merge(['perms' => $perms]);
$model = new SupplierChannelModel();
$query = $model->orderBy('update_time', 'desc');
$filter = new SupplierFilter();
$params = $request->except('user');
$params = $request->except('user','perms');
$params['need_audit'] = 1;
$params['source_type'] = 'all';
$query = $filter->listFilter($params, $query);
$count = $query->count();
$this->response(0, 'ok', $count);
......
......@@ -92,7 +92,7 @@ class CheckLogin
return $next($request);
}
private function getPerms()
public function getPerms()
{
$userId = request()->user->userId;
$permsUrl = env('PERM_LIST') . '/' . $userId . '/' . env('PERM_ID') . '/';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment