Merge pull request 'feat(store_product): 优化商品搜索和详情展示' (#386) from dev into main

Reviewed-on: #386
This commit is contained in:
mkm 2024-12-13 10:56:30 +08:00
commit 0cdde4f9a3
2 changed files with 10 additions and 1 deletions

View File

@ -34,7 +34,8 @@ class StoreProductLists extends BaseAdminDataLists implements ListsSearchInterfa
public function setSearch(): array
{
return [
'=' => ['cate_id', 'is_show', 'bar_code','product_type','id'],
'=' => ['cate_id', 'is_show', 'bar_code','id'],
'in' => ['product_type'],
'<=' => ['stock'],
'%like%' => ['store_name'],
];

View File

@ -16,6 +16,7 @@ use app\common\model\store_product_unit\StoreProductUnit;
use app\common\model\system_store\SystemStore;
use app\common\model\system_store_storage\SystemStoreStorage;
use app\common\model\user\User;
use app\common\model\warehouse_product_storege\WarehouseProductStorege;
use Illuminate\Support\Facades\Log;
use support\exception\BusinessException;
use think\facade\Db;
@ -314,6 +315,13 @@ class StoreProductLogic extends BaseLogic
$data = StoreProductGroupPrice::resetProductPrice($data, $userShip);
}
}
if($data['is_show']==1){
$data['status_msg']='上架|常用';
}else{
$data['status_msg']='下架|不常用|是否有替换';
}
$data['warehouse_nums']=WarehouseProductStorege::where('product_id', $params['id'])->where('warehouse_id',1)->value('nums')??0;
return $data;
}