|
...
|
...
|
@@ -103,24 +103,24 @@ class ProductLogic extends BaseLogic |
|
|
|
//先删除以前的数据
|
|
|
|
$extendInfoModel = new ExtendInfo();
|
|
|
|
$extendInfoModel->del(['project_id'=>$project_id]);
|
|
|
|
if(!empty($extend)){
|
|
|
|
foreach ($extend as $v){
|
|
|
|
unset($v['title']);
|
|
|
|
if(!empty($v['values'])){
|
|
|
|
if($v['type'] == 3 || $v['type'] == 4){
|
|
|
|
if(is_array($v['values'])){
|
|
|
|
foreach ($v['values'] as $k1=>$v1){
|
|
|
|
$v1 = str_replace_url($v1);
|
|
|
|
$v['values'][$k1] = $v1;
|
|
|
|
}
|
|
|
|
$v['values'] = json_encode($v['values']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$v['project_id'] = $this->user['project_id'];
|
|
|
|
$v['product_id'] = $project_id;
|
|
|
|
$extendInfoModel->add($v);
|
|
|
|
if(empty($extend)) {
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
foreach ($extend as $k => $v){
|
|
|
|
if(empty($v['values'])){
|
|
|
|
unset($extend[$k]);
|
|
|
|
}
|
|
|
|
unset($v['title']);
|
|
|
|
if($v['type'] == 3 || $v['type'] == 4){
|
|
|
|
foreach ($v['values'] as $k1=>$v1){
|
|
|
|
$v1 = str_replace_url($v1);
|
|
|
|
$v['values'][$k1] = $v1;
|
|
|
|
}
|
|
|
|
$v['values'] = json_encode($v['values']);
|
|
|
|
}
|
|
|
|
$v['project_id'] = $this->user['project_id'];
|
|
|
|
$v['product_id'] = $project_id;
|
|
|
|
$extendInfoModel->add($v);
|
|
|
|
}
|
|
|
|
return $this->success();
|
|
|
|
}
|
...
|
...
|
|