作者 lyh

更新产品扩展字段

... ... @@ -67,7 +67,7 @@ class ProductLogic extends BaseLogic
//产品分类关联
CategoryRelated::saveRelated($id, $category_ids);
//保存扩展字段
$this->saveExtendInfo($id,$extend);
$this->saveExtendInfo($this->user['project_id'],$extend);
DB::connection('custom_mysql')->commit();
}catch (\Exception $e){
DB::connection('custom_mysql')->rollBack();
... ... @@ -99,10 +99,10 @@ class ProductLogic extends BaseLogic
* @method :post
* @time :2023/11/9 15:02
*/
public function saveExtendInfo($id,$extend){
public function saveExtendInfo($project_id,$extend){
//先删除以前的数据
$extendInfoModel = new ExtendInfo();
$extendInfoModel->del(['project_id'=>$id]);
$extendInfoModel->del(['project_id'=>$project_id]);
if(!empty($extend)){
foreach ($extend as $v){
unset($v['title']);
... ... @@ -117,7 +117,7 @@ class ProductLogic extends BaseLogic
}
}
$v['project_id'] = $this->user['project_id'];
$v['product_id'] = $id;
$v['product_id'] = $project_id;
$extendInfoModel->add($v);
}
}
... ...