Merge branch 'dev' of https://gitea.lihaink.cn/mkm/multi-store into dev
This commit is contained in:
commit
b0f38e5bcd
@ -30,6 +30,7 @@ use app\common\model\user_ship\UserShip;
|
||||
use app\common\model\warehouse_order\WarehouseOrder;
|
||||
use app\common\model\warehouse_product\WarehouseProduct;
|
||||
use app\common\model\warehouse_product_return\WarehouseProductReturn;
|
||||
use app\common\model\warehouse_product_storege\WarehouseProductStorege;
|
||||
use app\common\service\xlsx\OrderAllocation;
|
||||
use app\common\service\xlsx\OrderInfo;
|
||||
use app\common\service\xlsx\OrderList;
|
||||
@ -93,13 +94,13 @@ class BeforehandOrderLogic extends BaseLogic
|
||||
$datas[$k]['mark'] = $v['mark'] ?? '';
|
||||
$datas[$k]['product_id'] = $v['product_id'];
|
||||
$datas[$k]['uid'] = $uid;
|
||||
$datas[$k]['marques'] = $v['marques'] ?? '';
|
||||
$datas[$k]['store_info'] = $v['store_info'] ?? '';
|
||||
$datas[$k]['after_sales'] = $v['after_sales'] ?? '';
|
||||
$datas[$k]['loss'] = $v['loss'] ?? '';
|
||||
// $datas[$k]['marques'] = $v['marques'] ?? '';
|
||||
// $datas[$k]['store_info'] = $v['store_info'] ?? '';
|
||||
// $datas[$k]['after_sales'] = $v['after_sales'] ?? '';
|
||||
// $datas[$k]['loss'] = $v['loss'] ?? '';
|
||||
$datas[$k]['unit'] = $v['unit'] ?? '';
|
||||
$datas[$k]['gross_weight'] = $v['gross_weight'] ?? '';
|
||||
$datas[$k]['net_weight'] = $v['net_weight'] ?? '';
|
||||
// $datas[$k]['gross_weight'] = $v['gross_weight'] ?? '';
|
||||
// $datas[$k]['net_weight'] = $v['net_weight'] ?? '';
|
||||
$datas[$k]['cart_num'] = $v['nums'];
|
||||
$datas[$k]['accept_num'] = $v['nums'];
|
||||
$datas[$k]['is_buyer'] = $is_buyer;
|
||||
@ -139,27 +140,27 @@ class BeforehandOrderLogic extends BaseLogic
|
||||
$datas[$k]['bhoid'] = $order['id'];
|
||||
|
||||
$data['id'] = $v['product_id'];
|
||||
if ($v['marques'] != '') {
|
||||
$data['marques'] = $v['marques'];
|
||||
}
|
||||
if ($v['store_info'] != '') {
|
||||
$data['store_info'] = $v['store_info'];
|
||||
}
|
||||
if ($v['after_sales'] != '') {
|
||||
$data['after_sales'] = $v['after_sales'];
|
||||
}
|
||||
if ($v['package'] != '') {
|
||||
$data['package'] = $v['package'];
|
||||
}
|
||||
if ($v['loss'] != '') {
|
||||
$data['loss'] = $v['loss'];
|
||||
}
|
||||
if ($v['gross_weight'] != '') {
|
||||
$data['gross_weight'] = $v['gross_weight'];
|
||||
}
|
||||
if ($v['net_weight'] != '') {
|
||||
$data['net_weight'] = $v['net_weight'];
|
||||
}
|
||||
// if ($v['marques'] != '') {
|
||||
// $data['marques'] = $v['marques'];
|
||||
// }
|
||||
// if ($v['store_info'] != '') {
|
||||
// $data['store_info'] = $v['store_info'];
|
||||
// }
|
||||
// if ($v['after_sales'] != '') {
|
||||
// $data['after_sales'] = $v['after_sales'];
|
||||
// }
|
||||
// if ($v['package'] != '') {
|
||||
// $data['package'] = $v['package'];
|
||||
// }
|
||||
// if ($v['loss'] != '') {
|
||||
// $data['loss'] = $v['loss'];
|
||||
// }
|
||||
// if ($v['gross_weight'] != '') {
|
||||
// $data['gross_weight'] = $v['gross_weight'];
|
||||
// }
|
||||
// if ($v['net_weight'] != '') {
|
||||
// $data['net_weight'] = $v['net_weight'];
|
||||
// }
|
||||
$product_arr[] = $data;
|
||||
}
|
||||
(new StoreProduct())->saveAll($product_arr);
|
||||
@ -375,11 +376,20 @@ class BeforehandOrderLogic extends BaseLogic
|
||||
if ($order['outbound_id'] > 0) {
|
||||
throw new BusinessException('该订单已创建出库单');
|
||||
}
|
||||
$info = BeforehandOrderCartInfo::where('bhoid', $params['bhoid'])->select();
|
||||
$info = BeforehandOrderCartInfo::where('bhoid', $params['bhoid'])->select()->toArray();
|
||||
// $product_column = array_column($info, 'product_id');
|
||||
// $storege_arr=WarehouseProductStorege::where('warehouse_id', $params['warehouse_id'])->where('product_id','in',$product_column)->select();
|
||||
foreach ($info as $k => $v) {
|
||||
if ($v['pay_price'] <= 0) {
|
||||
throw new BusinessException('商品价格为空 不能生成出库订单,对应id:' . $v['id']);
|
||||
}
|
||||
// foreach ($storege_arr as $key => $value) {
|
||||
// if ($value['is_verify']==1 && $v['product_id'] == $value['product_id']) {
|
||||
// if ($v['cart_num'] > $value['nums']) {
|
||||
// throw new BusinessException('仓库库存不足 不能生成出库订单,对应id:' . $v['id']);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
$count = BeforehandOrderCartInfo::where('bhoid', $params['bhoid'])->where('cart_num', 0)->count('id');
|
||||
if ($count > 0) {
|
||||
|
@ -240,18 +240,18 @@ class BeforehandOrderCartInfoLogic extends BaseLogic
|
||||
$data['manufacture'] = $v['manufacture'] > 0 ? date('Y-m-d H:i:s', $v['manufacture']) : '';
|
||||
$data['expiration_date'] = $v['expiration_date'] > 0 ? date('Y-m-d H:i:s', $v['expiration_date']) : '';
|
||||
$product_arr=[];
|
||||
if($v['package']!=''){
|
||||
$product_arr['package']=$v['package'];
|
||||
}
|
||||
if($v['store_info']!=''){
|
||||
$product_arr['store_info']=$v['store_info'];
|
||||
}
|
||||
if($v['marques']!=''){
|
||||
$product_arr['marques']=$v['marques'];
|
||||
}
|
||||
if($v['after_sales']!=''){
|
||||
$product_arr['after_sales']=$v['after_sales'];
|
||||
}
|
||||
// if($v['package']!=''){
|
||||
// $product_arr['package']=$v['package'];
|
||||
// }
|
||||
// if($v['store_info']!=''){
|
||||
// $product_arr['store_info']=$v['store_info'];
|
||||
// }
|
||||
// if($v['marques']!=''){
|
||||
// $product_arr['marques']=$v['marques'];
|
||||
// }
|
||||
// if($v['after_sales']!=''){
|
||||
// $product_arr['after_sales']=$v['after_sales'];
|
||||
// }
|
||||
if($product_arr!=[]){
|
||||
StoreProduct::where('id',$v['product_id'])->save($product_arr);
|
||||
}
|
||||
|
@ -84,10 +84,10 @@ class PurchaseProductOfferLogic extends BaseLogic
|
||||
'need_num' => $params['need_num'],
|
||||
'mark' => $mark,
|
||||
'buyer_id' => $params['buyer_id'],
|
||||
'package' => $find['package'],
|
||||
'store_info' => $find['store_info'],
|
||||
'marques' => $find['marques'],
|
||||
'after_sales' => $find['after_sales'],
|
||||
// 'package' => $find['package'],
|
||||
// 'store_info' => $find['store_info'],
|
||||
// 'marques' => $find['marques'],
|
||||
// 'after_sales' => $find['after_sales'],
|
||||
'status' => 0,
|
||||
'source_order_info' => [
|
||||
[
|
||||
|
Loading…
x
Reference in New Issue
Block a user