feat : add_staple_food
This commit is contained in:
@@ -248,6 +248,7 @@ trait OrderTrait
|
||||
'id' => $key,
|
||||
'spu_id' => $this->skuArr[$key]['spu_id'],
|
||||
'is_add_staple_food' => $this->skuArr[$key]['is_add_staple_food'],
|
||||
'meal_copies' => $this->skuArr[$key]['is_add_staple_food'] == GoodCode::IS_ADD_STAPLE_FOOD ? 0 : 1,
|
||||
];
|
||||
} else {
|
||||
$oneCopiesGoodInfo[$key]['num'] += $oneGood;
|
||||
@@ -265,11 +266,16 @@ trait OrderTrait
|
||||
'price' => $oneCopiesTotalPrice,
|
||||
];
|
||||
|
||||
// if ($copiesType == 1) {
|
||||
// $this->orderRes['optional_copies']++;
|
||||
// } else {
|
||||
$this->orderRes['copies']++;
|
||||
// }
|
||||
// 加一份米饭不算份数
|
||||
switch ($this->orderType) {
|
||||
case OrderCode::ORDER_TYPE_OPTIONAL:
|
||||
$this->orderRes['copies']++;
|
||||
break;
|
||||
case OrderCode::ORDER_TYPE_MEAL:
|
||||
$this->orderRes['copies'] = $this->orderRes['copies'] + array_sum(array_column($oneCopiesGoodInfo,'meal_copies'));
|
||||
break;
|
||||
}
|
||||
// if ($this->skuArr[$key]['is_add_staple_food'] != GoodCode::IS_ADD_STAPLE_FOOD) $this->orderRes['copies']++;
|
||||
|
||||
$this->orderRes['total_good_price'] = bcadd($this->orderRes['total_good_price'],$oneCopiesTotalPrice,2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user