Merge pull request '修改预订单一键入库' (#466) from dev into main
Reviewed-on: #466
This commit is contained in:
commit
d4104e5e46
@ -31,8 +31,9 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['order_id', 'store_id', 'pay_type', 'staff_id', 'shipping_type', 'delivery_id', 'paid', 'status', 'is_writeoff', 'is_merge', 'uid', 'source'],
|
||||
'between_time' => 'create_time'
|
||||
'=' => ['store_id', 'pay_type', 'staff_id', 'shipping_type', 'delivery_id', 'paid', 'status', 'is_writeoff', 'is_merge', 'uid', 'source'],
|
||||
'between_time' => 'create_time',
|
||||
'%like%' => ['order_id'],
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -529,6 +529,9 @@ class BeforehandOrderLogic extends BaseLogic
|
||||
$total_price = $order['total_price'];
|
||||
$uid = $order['uid'];
|
||||
foreach ($info as $k => $v) {
|
||||
if ($v['refund_num'] >= $v['cart_num']) {
|
||||
continue;
|
||||
}
|
||||
$datas[$k]['product_id'] = $v['product_id'];
|
||||
$datas[$k]['uid'] = $uid;
|
||||
$datas[$k]['cart_num'] = $v['cart_num'];
|
||||
@ -541,6 +544,9 @@ class BeforehandOrderLogic extends BaseLogic
|
||||
$datas[$k]['update_time'] = time();
|
||||
$total_num += $v['nums'];
|
||||
}
|
||||
if (empty($datas)) {
|
||||
throw new BusinessException('该订单商品已全部退款');
|
||||
}
|
||||
$other_data = [
|
||||
'nickname' => $order['real_name'] ?? '',
|
||||
'phone' => $order['user_phone'] ?? '',
|
||||
@ -991,13 +997,14 @@ class BeforehandOrderLogic extends BaseLogic
|
||||
switch ($params['warehouse_type']) {
|
||||
case 1:
|
||||
$where[] = ['is_outbound', '=', 0];
|
||||
$where[] = ['order_type', '<>', 5];
|
||||
$where[] = ['order_type', 'not in', [5, 7]];
|
||||
break;
|
||||
case 2:
|
||||
$where[] = ['is_outbound', '=', 1];
|
||||
break;
|
||||
case 3:
|
||||
$where[] = ['is_warehousing', '=', 0];
|
||||
$where[] = ['order_type', '<>', 1];
|
||||
break;
|
||||
case 4:
|
||||
$where[] = ['is_warehousing', '=', 1];
|
||||
@ -1011,12 +1018,12 @@ class BeforehandOrderLogic extends BaseLogic
|
||||
->group('order_type')
|
||||
->field([Db::raw('count(*) as count'), 'order_type'])->select();
|
||||
if ($params['order_type'] > 0) {
|
||||
$where2[] = ['order_type', '=', $params['order_type']];
|
||||
$where[] = ['order_type', '=', $params['order_type']];
|
||||
}
|
||||
$outbound_0 = BeforehandOrder::where([['is_outbound', '=', 0], ['order_type', '<>', 5]])->where($where2)->count();
|
||||
$outbound_1 = BeforehandOrder::where([['is_outbound', '=', 1]])->where($where2)->count();
|
||||
$warehousing_0 = BeforehandOrder::where([['is_warehousing', '=', 0]])->where($where2)->count();
|
||||
$warehousing_1 = BeforehandOrder::where([['is_warehousing', '=', 1]])->where($where2)->count();
|
||||
$outbound_0 = BeforehandOrder::where([['is_outbound', '=', 0], ['order_type', 'not in', [5, 7]]])->where($where)->count();
|
||||
$outbound_1 = BeforehandOrder::where([['is_outbound', '=', 1]])->where($where)->count();
|
||||
$warehousing_0 = BeforehandOrder::where([['is_warehousing', '=', 0]])->where('order_type', '<>', 1)->where($where)->count();
|
||||
$warehousing_1 = BeforehandOrder::where([['is_warehousing', '=', 1]])->where($where)->count();
|
||||
$data = [
|
||||
'order_type_1' => 0,
|
||||
'order_type_2' => 0,
|
||||
|
@ -205,6 +205,7 @@ class BeforehandOrderCartInfoLogic extends BaseLogic
|
||||
$arr = [
|
||||
'warehouse_id' => $params['warehouse_id'],
|
||||
'supplier_id' => 0,
|
||||
'oid' => $beforehandOrder['id'],
|
||||
'admin_id' => $params['admin_id'],
|
||||
'financial_pm' => 1,
|
||||
'batch' => 0,
|
||||
|
Loading…
x
Reference in New Issue
Block a user