|
|
|
@ -216,15 +216,24 @@ class ServerOrder extends Order |
|
|
|
|
$dataTypeFilter = $this->getFilterDataType($dataType); |
|
|
|
|
// 当前用户ID |
|
|
|
|
$userId = UserService::getCurrentLoginUserId(); |
|
|
|
|
// 查询数据 |
|
|
|
|
$query = $this; |
|
|
|
|
// 非店长不带入user_id查询 |
|
|
|
|
if (!UserService::isStore()) { |
|
|
|
|
$query = $query->where('user_id', '=', $userId); |
|
|
|
|
//判断当前用户身份 |
|
|
|
|
if (UserService::isDealerEngineer()) { |
|
|
|
|
//分销商工程师 |
|
|
|
|
return $this->where($dataTypeFilter) |
|
|
|
|
->where('dealer_id', '=', $userId) |
|
|
|
|
->where('is_delete', '=', 0) |
|
|
|
|
->count(); |
|
|
|
|
} elseif (UserService::isStore()) { |
|
|
|
|
// 店主 |
|
|
|
|
return $this->where($dataTypeFilter) |
|
|
|
|
->where('is_delete', '=', 0) |
|
|
|
|
->count(); |
|
|
|
|
} else { |
|
|
|
|
return $this->where($dataTypeFilter) |
|
|
|
|
->where('user_id', '=', $userId) |
|
|
|
|
->where('is_delete', '=', 0) |
|
|
|
|
->count(); |
|
|
|
|
} |
|
|
|
|
return $query->where($dataTypeFilter) |
|
|
|
|
->where('is_delete', '=', 0) |
|
|
|
|
->count(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -240,7 +249,7 @@ class ServerOrder extends Order |
|
|
|
|
switch ($dataType) { |
|
|
|
|
case 'all': |
|
|
|
|
break; |
|
|
|
|
//待确认 |
|
|
|
|
//待确认 |
|
|
|
|
case 'confirm': |
|
|
|
|
$filter[] = ['pay_status', '=', PayStatusEnum::SUCCESS]; |
|
|
|
|
$filter[] = ['order_status', '=', ServerEnum::APPLYDISPATCH]; |
|
|
|
|