|
@@ -97,8 +97,11 @@ class OrderService
|
|
|
Db::beginTransaction();
|
|
|
$timeUnix = strtotime("-30 minutes");
|
|
|
$orders = Order::where('order_status_system', 'PAYING')
|
|
|
- ->where('order_category','<>','DISHES')
|
|
|
- ->where('order_platform','<>','SYSTEM') // 后台产生的订单不自动取消
|
|
|
+ ->where('order_category','<>','DISHES') // 点餐不自动取消
|
|
|
+ // ->where('order_platform','<>','SYSTEM') // 后台产生的订单不自动取消
|
|
|
+ ->where(function($query){
|
|
|
+ $query->where('order_platform','<>','SYSTEM')->orWhereNull('order_platform');
|
|
|
+ })
|
|
|
->where('order_addtimes', '<', $timeUnix)
|
|
|
->get();
|
|
|
foreach ($orders as $order) {
|
|
@@ -114,7 +117,7 @@ class OrderService
|
|
|
$goodsSku = GoodsSku::where('goods_sku_id',$sheet->join_sheet_goods_sku_id)->first();
|
|
|
if (!empty($goodsSku) && !empty($goodsSku->goods_sku_storage_json)){
|
|
|
$skuStorageJson = json_decode($goodsSku->goods_sku_storage_json,true);
|
|
|
- if (isset($skuStorageJson['storage'])){
|
|
|
+ if (isset($skuStorageJson['storage']) && !empty($skuStorageJson['storage'])){
|
|
|
$skuStorageJson['storage'] = $skuStorageJson['storage'] + $sheet->order_sheet_num;
|
|
|
$goodsSku->goods_sku_storage_json = json_encode($skuStorageJson);
|
|
|
$goodsSku->save();
|