Merge branch 'develop'
This commit is contained in:
commit
f94305c479
@ -1132,7 +1132,12 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
||||
$cart['extension_one'] = $extension_one;
|
||||
$cart['extension_two'] = $extension_two;
|
||||
$cart['cost'] = $cost;
|
||||
|
||||
// 获取购物车ID
|
||||
foreach ($merchantCart['list'] as &$cart) {
|
||||
$cartIds[] = $cart['cart_id'];
|
||||
}
|
||||
unset($cart);
|
||||
|
||||
// 开始计算------------------------------------------------------------
|
||||
|
||||
// 实际支付金额
|
||||
|
@ -1794,6 +1794,7 @@ class ProductDgRepository extends BaseRepository
|
||||
$_num = $this->productOnceCountCart($where['product_id'],$data['product_attr_unique'], $userInfo->uid);
|
||||
$cart_num = $_num + $data['cart_num'];
|
||||
}
|
||||
|
||||
if ($sku['stock'] < $cart_num ) throw new ValidateException('库存不足');
|
||||
//添加购物车
|
||||
if (!$data['is_new']) {
|
||||
|
@ -68,7 +68,7 @@ class StoreCart extends BaseController
|
||||
{
|
||||
$data = $this->checkParams($validate);
|
||||
|
||||
if(!in_array($data['product_type'],[0,1,2,3,4,99])) return app('json')->fail('商品类型错误');
|
||||
if(!in_array($data['product_type'],[0,1,2,3,4])) return app('json')->fail('商品类型错误');
|
||||
if ($data['cart_num'] <= 0) return app('json')->fail('购买数量有误');
|
||||
$user = $this->request->userInfo();
|
||||
event('user.cart.before',compact('user','data'));
|
||||
@ -102,12 +102,7 @@ class StoreCart extends BaseController
|
||||
$data['source_id'] = $data['group_buying_id'];
|
||||
$data['product_id'] = $result['product']['product_id'];
|
||||
break;
|
||||
case 99: //小组代购
|
||||
$result = app()->make(ProductRepository::class)->cartCheck($data,$this->request->userInfo());
|
||||
[$source, $sourceId, $pid] = explode(':', $this->request->param('source', '0'), 3) + ['', '', ''];
|
||||
$data['source'] = (in_array($source, [0, 1]) && $pid == $data['product_id']) ? $source : 0;
|
||||
if ($data['source'] > 0) $data['source_id'] = intval($sourceId);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
unset($data['group_buying_id']);
|
||||
|
@ -70,7 +70,7 @@ class StoreCartDg extends BaseController
|
||||
public function create(validate $validate)
|
||||
{
|
||||
$data = $this->checkParams($validate);
|
||||
if(!in_array($data['product_type'],[0,1,2,3,4,99])) return app('json')->fail('商品类型错误');
|
||||
if(!in_array($data['product_type'],[0,1,2,3,4])) return app('json')->fail('商品类型错误');
|
||||
if ($data['cart_num'] <= 0) return app('json')->fail('购买数量有误');
|
||||
$user = $this->request->userInfo();
|
||||
event('user.cart.before',compact('user','data'));
|
||||
@ -104,12 +104,6 @@ class StoreCartDg extends BaseController
|
||||
$data['source_id'] = $data['group_buying_id'];
|
||||
$data['product_id'] = $result['product']['product_id'];
|
||||
break;
|
||||
case 99: //小组代购
|
||||
$result = app()->make(ProductDgRepository::class)->cartCheck($data,$this->request->userInfo());
|
||||
[$source, $sourceId, $pid] = explode(':', $this->request->param('source', '0'), 3) + ['', '', ''];
|
||||
$data['source'] = (in_array($source, [0, 1]) && $pid == $data['product_id']) ? $source : 0;
|
||||
if ($data['source'] > 0) $data['source_id'] = intval($sourceId);
|
||||
break;
|
||||
}
|
||||
|
||||
unset($data['group_buying_id']);
|
||||
|
@ -262,7 +262,7 @@ class SupplyChainOrderBrokerAgeJob implements JobInterface
|
||||
// SupplyChainBorkerage::create($dataArrSix);
|
||||
// }
|
||||
|
||||
\think\facade\Log::record('执行完毕');
|
||||
\think\facade\Log::record('供应链佣金分布执行完毕');
|
||||
|
||||
} catch (\Exception $e) {
|
||||
Log::info('小组服务佣金同步失败: ' . var_export($data, 1) . $e->getMessage());
|
||||
|
Loading…
x
Reference in New Issue
Block a user