Compare commits
3 Commits
20250804-0
...
20250805-0
| Author | SHA1 | Date | |
|---|---|---|---|
| 89797d5bfc | |||
| ba009f4a9d | |||
| ae0d0d83ac |
@@ -180,7 +180,7 @@ class GoodCache
|
|||||||
$imageList = $this->getOssObjects(array_merge($spuImage,$imageIdArr));
|
$imageList = $this->getOssObjects(array_merge($spuImage,$imageIdArr));
|
||||||
|
|
||||||
$chefIds = array_column($skuList,'chef_id');
|
$chefIds = array_column($skuList,'chef_id');
|
||||||
$chefList = $this->adminUserModel->getDataByIds($chefIds);
|
$chefList = $this->adminUserModel->getChefNameByIds($chefIds);
|
||||||
|
|
||||||
$skuListArr = [];
|
$skuListArr = [];
|
||||||
$imageArr = [];
|
$imageArr = [];
|
||||||
|
|||||||
@@ -107,6 +107,32 @@ class AdminUser extends Model
|
|||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array $ids
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getChefNameByIds(array $ids): array
|
||||||
|
{
|
||||||
|
$data = $this
|
||||||
|
->join('chef', function ($join) use ($ids) {
|
||||||
|
$join->on('chef.user_id', '=', 'admin_user.id')
|
||||||
|
->whereIn('chef.id', $ids)
|
||||||
|
->where('is_del',UserCode::IS_NO_DEL)
|
||||||
|
->select([
|
||||||
|
'admin_user.chinese_name',
|
||||||
|
'chef.id',
|
||||||
|
'admin_user.username',
|
||||||
|
]);
|
||||||
|
})
|
||||||
|
->get();
|
||||||
|
|
||||||
|
if ($data->isEmpty()) return [];
|
||||||
|
|
||||||
|
$data = $data->toArray();
|
||||||
|
|
||||||
|
return array_column($data,null,'id');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $ids
|
* @param array $ids
|
||||||
* @return array
|
* @return array
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ class SkuService extends BaseService
|
|||||||
$spuInfo = $this->spuModel->getInfoById($skuInfo->spu_id);
|
$spuInfo = $this->spuModel->getInfoById($skuInfo->spu_id);
|
||||||
if (empty($spuInfo)) throw new ErrException('数据出错');
|
if (empty($spuInfo)) throw new ErrException('数据出错');
|
||||||
|
|
||||||
$purchaseInfo = $this->purchaseModel->getListByCycleIdAndKitchenId($skuInfo->cycle_id,$spuInfo->kitchen_id);
|
$purchaseInfo = $this->purchaseModel->getListByCycleIdAndKitchenId($spuInfo->cycle_id,$spuInfo->kitchen_id);
|
||||||
$purchaseIds = [];
|
$purchaseIds = [];
|
||||||
if (!empty($purchaseInfo)) {
|
if (!empty($purchaseInfo)) {
|
||||||
foreach ($purchaseInfo->toArray() as $one) {
|
foreach ($purchaseInfo->toArray() as $one) {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class DriverService extends BaseService
|
|||||||
|
|
||||||
$list = $this->siteDriverStatementModel
|
$list = $this->siteDriverStatementModel
|
||||||
->when($searchCityId, function ($query) use ($searchCityId) {
|
->when($searchCityId, function ($query) use ($searchCityId) {
|
||||||
$query->whereIn('city_id', $searchCityId);
|
$query->where('city_id', $searchCityId);
|
||||||
})
|
})
|
||||||
->when($searchDriverId, function ($query) use ($searchDriverId) {
|
->when($searchDriverId, function ($query) use ($searchDriverId) {
|
||||||
$query->where('driver_id', $searchDriverId);
|
$query->where('driver_id', $searchDriverId);
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class SiteService extends BaseService
|
|||||||
|
|
||||||
$list = $this->siteDriverStatementModel
|
$list = $this->siteDriverStatementModel
|
||||||
->when($searchCityId, function ($query) use ($searchCityId) {
|
->when($searchCityId, function ($query) use ($searchCityId) {
|
||||||
$query->whereIn('city_id', $searchCityId);
|
$query->where('city_id', $searchCityId);
|
||||||
})
|
})
|
||||||
->when($searchSiteId, function ($query) use ($searchSiteId) {
|
->when($searchSiteId, function ($query) use ($searchSiteId) {
|
||||||
$query->where('site_id', $searchSiteId);
|
$query->where('site_id', $searchSiteId);
|
||||||
|
|||||||
Reference in New Issue
Block a user