修改采购商品信息

This commit is contained in:
lewis 2024-12-27 11:08:11 +08:00
parent b1b3396c0b
commit bebbd7083d
2 changed files with 5 additions and 1 deletions

View File

@ -57,6 +57,10 @@ class PurchaseProductOfferLists extends BaseApiDataLists implements ListsSearchI
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->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->image=$item->product->image ?? '';
$cateIds[] = $item->product->top_cate_id ?? 0;

View File

@ -24,7 +24,7 @@ class PurchaseProductOffer extends BaseModel
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');
}
}