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

Reviewed-on: #474
This commit is contained in:
mkm 2025-01-20 14:59:37 +08:00
commit 97d529e465
3 changed files with 14 additions and 3 deletions

View File

@ -75,8 +75,10 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte
default:
break;
}
if (!empty($this->params['store_staff_id'])) {
if (!empty($this->params['store_staff_id']) || !empty($this->params['is_store'])) {
$this->searchWhere[] = ['store_staff_id', '>', 0];
} else {
$this->searchWhere[] = ['store_staff_id', '=', 0];
}
if ($order_rk!='') {
$oid=WarehouseOrder::where('financial_pm',1)->where('code','like','%'.$order_rk)->column('id');

View File

@ -438,6 +438,7 @@ class BeforehandOrderLogic extends BaseLogic
WarehouseOrder::where('id', $res['id'])->update(['total_price' => $totalPrice, 'nums' => $finds['nums']]);
$order->save(['outbound_id' => $res['id'], 'is_outbound' => 1, 'pay_price' => $totalPrice]);
BeforehandOrderCartInfo::where('bhoid', $params['bhoid'])->update(['is_buyer' => -1]);
self::confirm(['id' => $params['bhoid']]);
Db::commit();
return true;
} catch (\Throwable $e) {
@ -1003,6 +1004,13 @@ class BeforehandOrderLogic extends BaseLogic
if ($params['store_id'] > 0) {
$where2[] = ['store_id', '=', $params['store_id']];
}
if (!empty($params['is_store'])) {
$where[] = ['store_staff_id', '>', 0];
$where2[] = ['store_staff_id', '>', 0];
} else {
$where[] = ['store_staff_id', '=', 0];
$where2[] = ['store_staff_id', '=', 0];
}
if ($params['start_time'] != '' && $params['end_time'] != '') {
$where2[] = ['create_time', 'between', [strtotime($params['start_time']), strtotime($params['end_time'])]];
}

View File

@ -280,8 +280,9 @@ class BeforehandOrderCartInfoLogic extends BaseLogic
PurchaseProductOffer::where('order_id',$find['bhoid'])->where('product_id',$find['product_id'])->update(['delete_time'=>time()]);
}
$res=BeforehandOrderCartInfo::destroy($params['id']);
$pay_price=BeforehandOrderCartInfo::where('bhoid', $params['id'])->sum('pay_price');
BeforehandOrder::where('id',$find['bhoid'])->update(['pay_price'=>$pay_price]);
$pay_price=BeforehandOrderCartInfo::where('bhoid', $find['bhoid'])->sum('pay_price');
$total_price=BeforehandOrderCartInfo::where('bhoid', $find['bhoid'])->sum('total_price');
BeforehandOrder::where('id',$find['bhoid'])->update(['pay_price'=>$pay_price, 'total_price'=>$total_price]);
return $res;
}