作者 lyh

gx

... ... @@ -287,6 +287,18 @@ class ProductController extends BaseController
}
/**
* @remark :直接编辑列表数据
* @name :editList
* @author :lyh
* @method :post
* @time :2023/10/26 9:48
*/
public function editList(ProductLogic $logic){
$logic->editList();
$this->response('success');
}
/**
* @remark :删除
* @name :delete
* @author :lyh
... ...
... ... @@ -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
... ...
... ... @@ -168,7 +168,7 @@ class UserLoginLogic
$info['is_customized'] = $project['is_customized'];
$info['is_upload_manage'] = $project['is_upload_manage'];
$info['upload_config'] = $project['upload_config'];
$info['configuration'] = $project['deploy_build']['configuration'];
$info['configuration'] = ($project['deploy_build']['configuration'] != null) ? $project['deploy_build']['configuration'] : (new \stdClass());
//保存项目缓存
Cache::put('user-'.$info['project_id'],$project,$minutes = null);
return $this->success($info);
... ...