|
...
|
...
|
@@ -6,6 +6,7 @@ use App\Helper\Arr; |
|
|
|
use App\Http\Logic\Bside\BaseLogic;
|
|
|
|
use App\Models\Product\Category;
|
|
|
|
use App\Models\Product\CategoryRelated;
|
|
|
|
use App\Models\Product\Keyword;
|
|
|
|
use App\Models\Product\Product;
|
|
|
|
use App\Models\RouteMap\RouteMap;
|
|
|
|
use App\Models\Template\BTemplate;
|
|
...
|
...
|
@@ -66,6 +67,53 @@ class ProductLogic extends BaseLogic |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :编辑列表数据
|
|
|
|
* @name :editList
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/10/26 9:49
|
|
|
|
*/
|
|
|
|
public function editList(){
|
|
|
|
if(isset($param['category_id']) && !empty($param['category_id'])){
|
|
|
|
$param['category_id'] = $this->getLastCategory($param['category_id']);
|
|
|
|
}
|
|
|
|
if(isset($param['keyword_id']) && !empty($param['keyword_id'])){
|
|
|
|
$param['keyword_id'] = ','.Arr::arrToSet($param['keyword_id']).',';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :保存关键字标签处理
|
|
|
|
* @name :saveKeyword
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/10/26 9:51
|
|
|
|
*/
|
|
|
|
public function saveKeyword($keyword){
|
|
|
|
$str = '';
|
|
|
|
if(!empty($keyword) && is_array($keyword)){
|
|
|
|
$keywordModel = new Keyword();
|
|
|
|
foreach ($keyword as $v){
|
|
|
|
//查询当前关键字是否存在
|
|
|
|
$info = $keywordModel->read(['title'=>$v],['id']);
|
|
|
|
if($info === false){
|
|
|
|
$param['project_id'] = $this->user['project_id'];
|
|
|
|
$param['created_at'] = date('Y-m-d H:i:s');
|
|
|
|
$param['updated_at'] = $param['created_at'];
|
|
|
|
$param['title'] = $v;
|
|
|
|
$id = $this->model->insertGetId($param);
|
|
|
|
$route = RouteMap::setRoute($v, RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']);
|
|
|
|
$this->model->edit(['route'=>$route],['id'=>$id]);
|
|
|
|
$str .= $id.',';
|
|
|
|
}else{
|
|
|
|
$str .= $info['id'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $str;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :不使用save处理参数
|
|
|
|
* @name :handleSaveParam
|
|
|
|
* @author :lyh
|
...
|
...
|
|