Merge pull request 'dev' (#258) from dev into main

Reviewed-on: https://gitea.lihaink.cn/mkm/multi-store/pulls/258
This commit is contained in:
mkm 2024-10-13 14:34:36 +08:00
commit 828522bc4e
2 changed files with 19 additions and 2 deletions

View File

@ -7,6 +7,7 @@ use app\admin\lists\BaseAdminDataLists;
use app\common\model\beforehand_order\BeforehandOrder; use app\common\model\beforehand_order\BeforehandOrder;
use app\common\lists\ListsSearchInterface; use app\common\lists\ListsSearchInterface;
use app\common\model\auth\Admin; use app\common\model\auth\Admin;
use app\common\model\purchase_product_offer\PurchaseProductOffer;
/** /**
* 预订单表列表 * 预订单表列表
@ -43,7 +44,7 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte
public function lists(): array public function lists(): array
{ {
return BeforehandOrder::where($this->searchWhere) return BeforehandOrder::where($this->searchWhere)
->field(['id','order_id', 'uid','order_type','total_num','total_price','outbound_id','admin_id', 'pay_price', 'deduction_price','create_time', 'status', 'mark']) ->field(['id','order_id', 'uid','order_type','total_num','total_price','outbound_id','admin_id', 'pay_price', 'deduction_price','create_time', 'status', 'mark','warehousing_id'])
->limit($this->limitOffset, $this->limitLength) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->order(['id' => 'desc'])
->select()->each(function ($item){ ->select()->each(function ($item){
@ -63,6 +64,16 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte
}elseif($item->order_type==5){ }elseif($item->order_type==5){
$item->order_type_name='仓库补货'; $item->order_type_name='仓库补货';
} }
$item->msg='';
$count1=PurchaseProductOffer::where('order_id',$item->id)->where('buyer_confirm',0)->count('id');
if($count1>0){
$item->msg='有'.$count1.'个商品采购中';
}else{
$count2=PurchaseProductOffer::where('order_id',$item->id)->where('buyer_confirm',1)->count('id');
if($count2>0 &&$item['warehousing_id']==0){
$item->msg='商品没有入库';
}
}
}) })
->toArray(); ->toArray();
} }

View File

@ -9,6 +9,7 @@ use app\api\logic\order\OrderLogic;
use app\common\model\beforehand_order\BeforehandOrder; use app\common\model\beforehand_order\BeforehandOrder;
use app\common\logic\BaseLogic; use app\common\logic\BaseLogic;
use app\common\model\beforehand_order_cart_info\BeforehandOrderCartInfo; use app\common\model\beforehand_order_cart_info\BeforehandOrderCartInfo;
use app\common\model\purchase_product_offer\PurchaseProductOffer;
use app\common\model\store_branch_product\StoreBranchProduct; use app\common\model\store_branch_product\StoreBranchProduct;
use app\common\model\store_order\StoreOrder; use app\common\model\store_order\StoreOrder;
use app\common\model\store_order_cart_info\StoreOrderCartInfo; use app\common\model\store_order_cart_info\StoreOrderCartInfo;
@ -400,7 +401,12 @@ class BeforehandOrderLogic extends BaseLogic
*/ */
public static function delete(array $params): bool public static function delete(array $params): bool
{ {
return BeforehandOrder::destroy($params['id']); $res= BeforehandOrder::destroy($params['id']);
if($res){
BeforehandOrderCartInfo::where('bhoid',$params['id'])->update(['delete_time'=>time()]);
PurchaseProductOffer::where('order_id',$params['id'])->update(['delete_time'=>time()]);
}
return $res;
} }