|
...
|
...
|
@@ -14,6 +14,7 @@ use App\Models\RouteMap\RouteMap; |
|
|
|
use App\Models\Template\BTemplate;
|
|
|
|
use App\Services\CosService;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class ProductLogic
|
|
...
|
...
|
@@ -46,7 +47,11 @@ class ProductLogic extends BaseLogic |
|
|
|
$this->param = $this->handleSaveParam($this->param);
|
|
|
|
try {
|
|
|
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
|
|
$this->param['route'] = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT, $this->param['id'], $this->user['project_id']);
|
|
|
|
$is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0
|
|
|
|
$six_read = $this->param['six_read'] ?? 0;//是否按6.0显示
|
|
|
|
if($is_upgrade == 0 || $six_read == 1){
|
|
|
|
$this->param['route'] = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT, $this->param['id'], $this->user['project_id']);
|
|
|
|
}
|
|
|
|
$route = $this->param['route'];
|
|
|
|
$this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
|
|
$id = $this->param['id'];
|
|
...
|
...
|
@@ -62,6 +67,7 @@ class ProductLogic extends BaseLogic |
|
|
|
//保存扩展字段
|
|
|
|
$this->saveExtendInfo($id,$extend);
|
|
|
|
}catch (\Exception $e){
|
|
|
|
Log::info('错误信息---'.$e->getMessage());
|
|
|
|
$this->fail('系统错误请联系管理员');
|
|
|
|
}
|
|
|
|
$this->addUpdateNotify(RouteMap::SOURCE_PRODUCT,$route);
|
|
...
|
...
|
@@ -193,6 +199,7 @@ class ProductLogic extends BaseLogic |
|
|
|
* @time :2023/10/26 9:49
|
|
|
|
*/
|
|
|
|
public function editList(){
|
|
|
|
$category_ids = $this->param['category_id'];
|
|
|
|
$this->param['category_id'] = $this->handleListCategory($this->param['category_id']);
|
|
|
|
$this->param['keyword_id'] = $this->saveKeyword($this->param['keyword_id']);
|
|
|
|
if(isset($this->param['gallery']) && !empty($this->param['gallery'])){
|
|
...
|
...
|
@@ -208,9 +215,11 @@ class ProductLogic extends BaseLogic |
|
|
|
try {
|
|
|
|
if(isset($this->param['route']) && !empty($this->param['route'])){
|
|
|
|
$this->param['route'] = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT, $this->param['id'], $this->user['project_id']);
|
|
|
|
$this->editProductRoute($this->param['id'],$this->param['route']);
|
|
|
|
// $this->editProductRoute($this->param['id'],$this->param['route']);
|
|
|
|
}
|
|
|
|
$this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
|
|
//产品分类关联
|
|
|
|
CategoryRelated::saveRelated($this->param['id'], $category_ids);
|
|
|
|
}catch (\Exception $e){
|
|
|
|
$this->fail('系统错误,请连续管理员');
|
|
|
|
}
|
|
...
|
...
|
@@ -278,6 +287,7 @@ class ProductLogic extends BaseLogic |
|
|
|
}
|
|
|
|
if(isset($param['video'])){
|
|
|
|
$param['video']['url'] = str_replace_url($param['video']['url']);
|
|
|
|
$param['video']['video_image'] = str_replace_url($param['video']['video_image']);
|
|
|
|
$param['video'] = Arr::a2s($param['video'] ?? []);
|
|
|
|
}
|
|
|
|
if(isset($param['keyword_id']) && !empty($param['keyword_id'])){
|
|
...
|
...
|
@@ -313,7 +323,7 @@ class ProductLogic extends BaseLogic |
|
|
|
$str .= $v.',';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return !empty($str) ? ','.$str : '';
|
|
|
|
return !empty(trim($str,',')) ? ','.$str.',' : '';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
...
|
...
|
|