feat: place Order
This commit is contained in:
@@ -14,6 +14,7 @@ use App\Cache\Redis\Api\ApiRedisKey;
|
||||
use App\Cache\Redis\Api\SiteCache;
|
||||
use App\Cache\Redis\RedisCache;
|
||||
use App\Constants\ApiCode;
|
||||
use App\Constants\Common\GoodCode;
|
||||
use App\Exception\ErrException;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
@@ -165,19 +166,21 @@ trait OrderTrait
|
||||
|
||||
$oneCopiesGoodInfo = [];
|
||||
foreach ($oneCopies as $oneGood) {
|
||||
if (empty($oneCopiesGoodInfo[$oneGood]))
|
||||
{
|
||||
if (empty($oneCopiesGoodInfo[$oneGood])) {
|
||||
$oneCopiesGoodInfo[$oneGood] = [
|
||||
'num' => 1,
|
||||
'good_name' => '1',
|
||||
'good_url' => '1',
|
||||
'unit_price' => $this->skuArr[$oneGood]['price']
|
||||
'unit_price' => $this->skuArr[$oneGood]['price'],
|
||||
'type' => $this->skuArr[$oneGood]['type'],
|
||||
];
|
||||
} else {
|
||||
$oneCopiesGoodInfo[$oneGood]['num'] += 1;
|
||||
}
|
||||
|
||||
$oneCopiesTotalPrice = bcadd($oneCopiesTotalPrice, $this->skuArr[$oneGood]['price'],2);
|
||||
|
||||
if ($copiesType == 1 && $this->skuArr[$oneGood]['type'] == 2) {
|
||||
if ($copiesType == 1 && $this->skuArr[$oneGood]['type'] == GoodCode::SPU_TYPE_MEAL) {
|
||||
$copiesType = 2;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user