上传
This commit is contained in:
parent
b1d1d54187
commit
5867fe5895
@ -284,8 +284,9 @@ class ProductRepository extends BaseRepository
|
||||
$spuData['price'] = $settleParams['data']['price'];
|
||||
$spuData['mer_id'] = $merId;
|
||||
$spuData['mer_labels'] = $data['mer_labels'];
|
||||
Db::transaction(function () use ($id, $data, $productType, $settleParams, $content, $product, $spuData, $merId) {
|
||||
$this->save($id, $settleParams, $content, $product, $productType);
|
||||
Db::startTrans();
|
||||
try{
|
||||
$res=$this->save($id, $settleParams, $content, $product, $productType);
|
||||
// if ($productType == 1) { //秒杀商品
|
||||
// $dat = $this->setSeckillProduct($data);
|
||||
// app()->make(StoreSeckillActiveRepository::class)->updateByProduct($id, $dat);
|
||||
@ -300,8 +301,13 @@ class ProductRepository extends BaseRepository
|
||||
if ($data['status'] == 0) {
|
||||
event('product.sell', ['product_id' => [$id]]);
|
||||
}
|
||||
app()->make(SpuRepository::class)->changeStatus($id, $productType);
|
||||
});
|
||||
app()->make(SpuRepository::class)->changeStatus($id, $productType);
|
||||
Db::commit();
|
||||
return $res;
|
||||
}catch(\Exception $e){
|
||||
Db::rollback();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function freeTrial(int $id, array $data, int $merId)
|
||||
|
Loading…
x
Reference in New Issue
Block a user