diff --git a/app/admin/lists/beforehand_order/BeforehandOrderThreeLists.php b/app/admin/lists/beforehand_order/BeforehandOrderThreeLists.php index 38ff72fc0..726bca26c 100644 --- a/app/admin/lists/beforehand_order/BeforehandOrderThreeLists.php +++ b/app/admin/lists/beforehand_order/BeforehandOrderThreeLists.php @@ -18,7 +18,7 @@ use app\common\model\warehouse_product\WarehouseProduct; */ class BeforehandOrderThreeLists extends BaseAdminDataLists implements ListsSearchInterface { - + public $outbound_id; /** * @notes 设置搜索条件 @@ -48,6 +48,7 @@ class BeforehandOrderThreeLists extends BaseAdminDataLists implements ListsSearc if(empty($outbound_id)){ return []; } + $this->outbound_id=$outbound_id; $this->searchWhere[]=['oid','=',$outbound_id]; $this->searchWhere[]=['financial_pm','=',0]; return WarehouseProduct::where($this->searchWhere)->select() @@ -79,7 +80,11 @@ class BeforehandOrderThreeLists extends BaseAdminDataLists implements ListsSearc */ public function count(): int { - return WarehouseProduct::where($this->searchWhere)->count(); + if($this->outbound_id>0){ + return WarehouseProduct::where($this->searchWhere)->count(); + }else{ + return 0; + } } } \ No newline at end of file diff --git a/app/admin/lists/beforehand_order/BeforehandOrderTwoLists.php b/app/admin/lists/beforehand_order/BeforehandOrderTwoLists.php index 539019f23..1b47ce629 100644 --- a/app/admin/lists/beforehand_order/BeforehandOrderTwoLists.php +++ b/app/admin/lists/beforehand_order/BeforehandOrderTwoLists.php @@ -19,7 +19,7 @@ use app\common\model\warehouse_product\WarehouseProduct; class BeforehandOrderTwoLists extends BaseAdminDataLists implements ListsSearchInterface { - + public $warehousing_id; /** * @notes 设置搜索条件 * @return \string[][] @@ -48,6 +48,7 @@ class BeforehandOrderTwoLists extends BaseAdminDataLists implements ListsSearchI if(empty($warehousing_id)){ return []; } + $this->warehousing_id=$warehousing_id; $this->searchWhere[]=['oid','=',$warehousing_id]; $this->searchWhere[]=['financial_pm','=',1]; return WarehouseProduct::where($this->searchWhere)->select() @@ -79,7 +80,11 @@ class BeforehandOrderTwoLists extends BaseAdminDataLists implements ListsSearchI */ public function count(): int { - return WarehouseProduct::where($this->searchWhere)->count(); + if($this->warehousing_id>0){ + return WarehouseProduct::where($this->searchWhere)->count(); + }else{ + return 0; + } } } \ No newline at end of file diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index 0aba0a355..7f792b6e3 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -41,6 +41,7 @@ class BeforehandOrderLogic extends BaseLogic $total_price = 0; $uid = $params['uid'] ?? 0; foreach ($params['product_arr'] as $k => $v) { + $datas[$k]['mark'] = $v['mark']??''; $datas[$k]['product_id'] = $v['product_id']; $datas[$k]['uid'] = $uid; $datas[$k]['cart_num'] = $v['nums']; @@ -61,7 +62,8 @@ class BeforehandOrderLogic extends BaseLogic 'pay_type' => 0, 'deduction_price' => 0, 'paid' => 0, - 'mark' => $params['mark'] ?? '' + 'mark' => $params['mark'] ?? '', + 'order_type' => $params['order_type'] ?? 0 ]); foreach ($datas as $k => $v) { $datas[$k]['bhoid'] = $order['id']; diff --git a/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php b/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php index 5a3ad6766..0378d87c3 100644 --- a/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php +++ b/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php @@ -97,8 +97,8 @@ class BeforehandOrderCartInfoLogic extends BaseLogic Db::startTrans(); try { BeforehandOrderCartInfo::where('id', $params['id'])->update([ - 'price' => $params['purchase'], - 'total_price' => $params['total_price'], + 'price' => $params['purchases'], + 'total_price' => bcmul($params['purchases'],$params['nums'],2), 'cart_num' => $params['nums'], ]); $bhoid = $params['bhoid']; @@ -117,6 +117,9 @@ class BeforehandOrderCartInfoLogic extends BaseLogic */ public static function oneClickStorage($params) { + if($params['bhoid']<=0){ + throw new BusinessException('参数错误'); + } $count = PurchaseProductOffer::where(['order_id' => $params['bhoid'], 'is_storage' => 0, 'buyer_nums' => 0])->count('id'); $warehousing_id = BeforehandOrder::where('id', $params['bhoid'])->value('warehousing_id');