作者 lyh

修改产品分类保存

... ... @@ -213,29 +213,6 @@ class ProductController extends BaseController
}
/**
* @remark :获取所有关键词
* @name :getCategoryList
* @author :lyh
* @method :post
* @time :2023/9/14 13:56
*/
public function getKeywordsList(){
$data = Common::get_user_cache('product_keyword',$this->user['project_id']);
if(empty($data)) {
$keywordModel = new Keyword();
$data = [];
$cateList = $keywordModel->list(['project_id' => $this->user['project_id']], ['id', 'title']);
if (!empty($cateList)) {
foreach ($cateList as $value) {
$data[$value['id']] = $value['title'];
}
}
Common::set_user_cache($data,'product_keyword',$this->user['project_id']);
}
return $data;
}
/**
* @remark :获取分类名称
* @name :categoryName
* @author :lyh
... ...
... ... @@ -326,13 +326,10 @@ class ProductLogic extends BaseLogic
* @time :2023/10/20 9:02
*/
public function handleListCategory($category){
$str = '';
if(isset($category) && !empty($category)){
foreach ($category as $v){
$str .= $v.',';
}
return ','.implode(',',$category).',';
}
return !empty(trim($str,',')) ? ','.$str.',' : '';
return '';
}
... ...