commit
456059d242
@ -126,7 +126,7 @@ class ActivityZoneFormLogic extends BaseLogic
|
|||||||
$service = new ActivityZoneService();
|
$service = new ActivityZoneService();
|
||||||
$activityZoneForm = ActivityZoneForm::findOrEmpty($params['id'])->toArray();
|
$activityZoneForm = ActivityZoneForm::findOrEmpty($params['id'])->toArray();
|
||||||
$productIds = ActivityZone::where('form_id', $params['id'])->column('product_id');
|
$productIds = ActivityZone::where('form_id', $params['id'])->column('product_id');
|
||||||
$products = StoreProduct::field('id,unit,store_name,two_cate_id')->whereIn('id', $productIds)->order('two_cate_id')->select()->toArray();
|
$products = StoreProduct::field('id,unit,store_name,two_cate_id')->whereIn('id', $productIds)->order('two_cate_id asc,cate_id asc')->select()->toArray();
|
||||||
$unitIds = array_unique(array_column($products, 'unit'));
|
$unitIds = array_unique(array_column($products, 'unit'));
|
||||||
$cateIds = array_unique(array_column($products, 'two_cate_id'));
|
$cateIds = array_unique(array_column($products, 'two_cate_id'));
|
||||||
$unit = StoreProductUnit::whereIn('id', $unitIds)->field('id,name')->withTrashed()->select()->toArray();
|
$unit = StoreProductUnit::whereIn('id', $unitIds)->field('id,name')->withTrashed()->select()->toArray();
|
||||||
|
@ -57,6 +57,10 @@ class PurchaseProductOfferLists extends BaseApiDataLists implements ListsSearchI
|
|||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['id' => 'desc'])
|
->order(['id' => 'desc'])
|
||||||
->select()->each(function($item) use(&$cateIds, &$supplierIds, &$unitIds) {
|
->select()->each(function($item) use(&$cateIds, &$supplierIds, &$unitIds) {
|
||||||
|
$item->store_info = empty($item['store_info']) ? ($item['product']['store_info'] ?? '') : $item['store_info'];
|
||||||
|
$item->after_sales = empty($item['after_sales']) ? ($item['product']['after_sales'] ?? '') : $item['after_sales'];
|
||||||
|
$item->marques = empty($item['marques']) ? ($item['product']['marques'] ?? '') : $item['marques'];
|
||||||
|
$item->package = empty($item['package']) ? ($item['product']['package'] ?? '') : $item['package'];
|
||||||
$item->store_name=$item->product->store_name ?? '';
|
$item->store_name=$item->product->store_name ?? '';
|
||||||
$item->image=$item->product->image ?? '';
|
$item->image=$item->product->image ?? '';
|
||||||
$cateIds[] = $item->product->top_cate_id ?? 0;
|
$cateIds[] = $item->product->top_cate_id ?? 0;
|
||||||
|
@ -24,7 +24,7 @@ class PurchaseProductOffer extends BaseModel
|
|||||||
|
|
||||||
public function product()
|
public function product()
|
||||||
{
|
{
|
||||||
return $this->hasOne(StoreProduct::class, 'id', 'product_id')->field('id,store_name,top_cate_id,image');
|
return $this->hasOne(StoreProduct::class, 'id', 'product_id')->field('id,store_name,top_cate_id,image,store_info,package,marques,after_sales');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user