作者 lyh

gx

... ... @@ -110,8 +110,8 @@ class CategoryLogic extends BaseLogic
* @time :2023/8/21 17:14
*/
public function categorySave(){
// DB::beginTransaction();
// try {
DB::beginTransaction();
try {
if(isset($this->param['id']) && !empty($this->param['id'])){
//是否编辑路由
$id = $this->editCategoryRoute($this->param['id'],$this->param['route']);
... ... @@ -128,11 +128,11 @@ class CategoryLogic extends BaseLogic
$this->edit(['route'=>$route],['id'=>$id]);
//清除缓存
Common::del_user_cache('product_category',$this->user['project_id']);
// DB::commit();
// } catch (\Exception $e){
// DB::rollBack();
// $this->fail('系统错误,请联系管理员');
// }
DB::commit();
} catch (\Exception $e){
DB::rollBack();
$this->fail('系统错误,请联系管理员');
}
//通知更新
$notifyData = ['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_PRODUCT_CATE, 'route'=>$route];
$this->updateNotify($notifyData);
... ...