|
...
|
...
|
@@ -518,8 +518,8 @@ class ProductLogic extends BaseLogic |
|
|
|
public function setCopyProduct(){
|
|
|
|
$info = $this->model->read(['id'=>$this->param['id']]);
|
|
|
|
$param = $this->setProductParams($info);
|
|
|
|
DB::beginTransaction();
|
|
|
|
try {
|
|
|
|
// DB::beginTransaction();
|
|
|
|
// try {
|
|
|
|
$save_id = $this->model->insertGetId($param);
|
|
|
|
CategoryRelated::saveRelated($save_id, $info['category_id']);
|
|
|
|
$route = preg_replace('/-product.*/', '', $param['route']);
|
|
...
|
...
|
@@ -532,11 +532,11 @@ class ProductLogic extends BaseLogic |
|
|
|
$this->copyExtendInfo($info['id'],$save_id);
|
|
|
|
$this->copyColumn($info['id'],$save_id);
|
|
|
|
$this->copyDetail($info['id'],$save_id);
|
|
|
|
DB::commit();
|
|
|
|
}catch (\Exception $e){
|
|
|
|
DB::rollBack();
|
|
|
|
$this->fail('复制失败,请联系管理员');
|
|
|
|
}
|
|
|
|
// DB::commit();
|
|
|
|
// }catch (\Exception $e){
|
|
|
|
// DB::rollBack();
|
|
|
|
// $this->fail('复制失败,请联系管理员');
|
|
|
|
// }
|
|
|
|
return $this->success(['id'=>$save_id]);
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|