作者 lyh

gx

... ... @@ -53,8 +53,8 @@ class ProductLogic extends BaseLogic
}else{
$this->param['category_id'] = '';
}
// DB::connection('custom_mysql')->beginTransaction();
// try {
DB::connection('custom_mysql')->beginTransaction();
try {
if(isset($this->param['id']) && !empty($this->param['id'])){
$id = $this->param['id'];
//查看路由是否更新
... ... @@ -70,11 +70,11 @@ class ProductLogic extends BaseLogic
CategoryRelated::saveRelated($id, $category_ids);
//保存扩展字段
$this->saveExtendInfo($id,$extend);
// DB::connection('custom_mysql')->commit();
// }catch (\Exception $e){
// DB::connection('custom_mysql')->rollBack();
// $this->fail('系统错误请联系管理员');
// }
DB::connection('custom_mysql')->commit();
}catch (\Exception $e){
DB::connection('custom_mysql')->rollBack();
$this->fail('系统错误请联系管理员');
}
//通知更新
$this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_PRODUCT, 'route'=>$this->param['route']]);
return $this->success();
... ...