作者 lyh

gx

@@ -287,6 +287,18 @@ class ProductController extends BaseController @@ -287,6 +287,18 @@ class ProductController extends BaseController
287 } 287 }
288 288
289 /** 289 /**
  290 + * @remark :直接编辑列表数据
  291 + * @name :editList
  292 + * @author :lyh
  293 + * @method :post
  294 + * @time :2023/10/26 9:48
  295 + */
  296 + public function editList(ProductLogic $logic){
  297 + $logic->editList();
  298 + $this->response('success');
  299 + }
  300 +
  301 + /**
290 * @remark :删除 302 * @remark :删除
291 * @name :delete 303 * @name :delete
292 * @author :lyh 304 * @author :lyh
@@ -6,6 +6,7 @@ use App\Helper\Arr; @@ -6,6 +6,7 @@ use App\Helper\Arr;
6 use App\Http\Logic\Bside\BaseLogic; 6 use App\Http\Logic\Bside\BaseLogic;
7 use App\Models\Product\Category; 7 use App\Models\Product\Category;
8 use App\Models\Product\CategoryRelated; 8 use App\Models\Product\CategoryRelated;
  9 +use App\Models\Product\Keyword;
9 use App\Models\Product\Product; 10 use App\Models\Product\Product;
10 use App\Models\RouteMap\RouteMap; 11 use App\Models\RouteMap\RouteMap;
11 use App\Models\Template\BTemplate; 12 use App\Models\Template\BTemplate;
@@ -66,6 +67,53 @@ class ProductLogic extends BaseLogic @@ -66,6 +67,53 @@ class ProductLogic extends BaseLogic
66 } 67 }
67 68
68 /** 69 /**
  70 + * @remark :编辑列表数据
  71 + * @name :editList
  72 + * @author :lyh
  73 + * @method :post
  74 + * @time :2023/10/26 9:49
  75 + */
  76 + public function editList(){
  77 + if(isset($param['category_id']) && !empty($param['category_id'])){
  78 + $param['category_id'] = $this->getLastCategory($param['category_id']);
  79 + }
  80 + if(isset($param['keyword_id']) && !empty($param['keyword_id'])){
  81 + $param['keyword_id'] = ','.Arr::arrToSet($param['keyword_id']).',';
  82 + }
  83 + }
  84 +
  85 + /**
  86 + * @remark :保存关键字标签处理
  87 + * @name :saveKeyword
  88 + * @author :lyh
  89 + * @method :post
  90 + * @time :2023/10/26 9:51
  91 + */
  92 + public function saveKeyword($keyword){
  93 + $str = '';
  94 + if(!empty($keyword) && is_array($keyword)){
  95 + $keywordModel = new Keyword();
  96 + foreach ($keyword as $v){
  97 + //查询当前关键字是否存在
  98 + $info = $keywordModel->read(['title'=>$v],['id']);
  99 + if($info === false){
  100 + $param['project_id'] = $this->user['project_id'];
  101 + $param['created_at'] = date('Y-m-d H:i:s');
  102 + $param['updated_at'] = $param['created_at'];
  103 + $param['title'] = $v;
  104 + $id = $this->model->insertGetId($param);
  105 + $route = RouteMap::setRoute($v, RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']);
  106 + $this->model->edit(['route'=>$route],['id'=>$id]);
  107 + $str .= $id.',';
  108 + }else{
  109 + $str .= $info['id'];
  110 + }
  111 + }
  112 + }
  113 + return $str;
  114 + }
  115 +
  116 + /**
69 * @remark :不使用save处理参数 117 * @remark :不使用save处理参数
70 * @name :handleSaveParam 118 * @name :handleSaveParam
71 * @author :lyh 119 * @author :lyh
@@ -168,7 +168,7 @@ class UserLoginLogic @@ -168,7 +168,7 @@ class UserLoginLogic
168 $info['is_customized'] = $project['is_customized']; 168 $info['is_customized'] = $project['is_customized'];
169 $info['is_upload_manage'] = $project['is_upload_manage']; 169 $info['is_upload_manage'] = $project['is_upload_manage'];
170 $info['upload_config'] = $project['upload_config']; 170 $info['upload_config'] = $project['upload_config'];
171 - $info['configuration'] = $project['deploy_build']['configuration']; 171 + $info['configuration'] = ($project['deploy_build']['configuration'] != null) ? $project['deploy_build']['configuration'] : (new \stdClass());
172 //保存项目缓存 172 //保存项目缓存
173 Cache::put('user-'.$info['project_id'],$project,$minutes = null); 173 Cache::put('user-'.$info['project_id'],$project,$minutes = null);
174 return $this->success($info); 174 return $this->success($info);