Merge pull request 'feat: 使用withTrashed方法查询带删除标记的产品信息' (#231) from cc into main

Reviewed-on: https://gitea.lihaink.cn/mkm/multi-store/pulls/231
This commit is contained in:
mkm 2024-09-22 11:45:55 +08:00
commit f3598de7db
2 changed files with 3 additions and 3 deletions

View File

@ -53,7 +53,7 @@ class StoreOrderCartInfoLists extends BaseAdminDataLists implements ListsSearchI
return StoreOrderCartInfo::where($this->searchWhere)
->field('id,oid,uid,product_id,store_id,cart_num,price,total_price,create_time')->limit($this->limitOffset, $this->limitLength)
->select()->each(function ($item) {
$find=StoreProduct::where('id',$item['product_id'])->field('image,unit,store_name,store_info')->find();
$find=StoreProduct::where('id',$item['product_id'])->field('image,unit,store_name,store_info')->withTrashed()->find();
$item['nickname']='无';
$item['mobile']='';
if($find){

View File

@ -52,7 +52,7 @@ class WarehouseProductLists extends BaseAdminDataLists implements ListsSearchInt
{
if ($this->request->get('product_id')) {
$product_id = $this->request->get('product_id');
$ids = StoreProduct::where('store_name', 'like', '%' . $product_id . '%')->column('id');
$ids = StoreProduct::where('store_name', 'like', '%' . $product_id . '%')->withTrashed()->column('id');
if ($ids) {
$this->searchWhere[] = ['product_id', 'in', $ids];
$this->ids = $ids;
@ -62,7 +62,7 @@ class WarehouseProductLists extends BaseAdminDataLists implements ListsSearchInt
}
if ($this->request->get('bar_code')) {
$bar_code = $this->request->get('bar_code');
$ids = StoreProduct::where('bar_code', 'like', '%' . $bar_code . '%')->column('id');
$ids = StoreProduct::where('bar_code', 'like', '%' . $bar_code . '%')->withTrashed()->column('id');
if ($ids) {
$this->searchWhere[] = ['product_id', 'in', $ids];
$this->ids = $ids;