作者 lyh

gx

... ... @@ -51,8 +51,8 @@ class ProductLogic extends BaseLogic
$category_ids = $this->getLastCategoryArr($this->param['category_id']);
$this->param['category_id'] = ','.implode(',',$category_ids).',';
}
// 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'];
//查看路由是否更新
... ... @@ -68,11 +68,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'=>$route]);
return $this->success();
... ... @@ -107,7 +107,7 @@ class ProductLogic extends BaseLogic
if(!empty($extend)){
foreach ($extend as $v){
unset($v['title']);
if(!empty($values)){
if(!empty($v['values'])){
if($v['type'] == 3 || $v['type'] || 4){
$v['values'] = str_replace_url($v['values']);
}
... ...