作者 lyh

gx

... ... @@ -278,7 +278,7 @@ class FileController
$projectModel = new Project();
$project_info = $projectModel->read(['id' => $this->cache['project_id']], ['project_location']);
if ($project_info['project_location'] == 0) {//不为普通项目时 上传到本地服务器
$this->upload_location = 1;//上传到cos
$this->upload_location = 1;//1:上传到本地
}
}
$this->path = $this->uploads['path_b'].'/'.$this->cache['project_id'].'/'.$this->file_type[$this->param['refer']].'/'.date('Y-m');
... ...
... ... @@ -58,6 +58,7 @@ class ProductLogic extends BaseLogic
foreach ($info['keyword_id'] as $keyword_id){
$info['keyword_id_text'][] =(new KeywordLogic())->getCacheInfo($keyword_id)['title']??'';
}
$info['product_type_text'] = $this->model->productType[$info['product_type']];
$info['category_id_text'] = Arr::arrToSet($info['category_id_text'], 'trim');
$info['keyword_id_text'] = Arr::arrToSet($info['keyword_id_text'], 'trim');
$info['status_text'] = Product::statusMap()[$info['status']] ?? '';
... ...
... ... @@ -32,6 +32,15 @@ class Product extends Base
];
}
/**
* @var 获取产品类型
*/
public $productType = [
1=>'一般产品',
2=>'推荐产品',
3=>'热销产品'
];
public function setThumbAttribute($value){
$this->attributes['thumb'] = Arr::a2s($value);
}
... ...
... ... @@ -4,7 +4,7 @@ namespace App\Services;
use Qcloud\Cos\Client;
/**
* @remark :
* @remark :对象存储cos
* @class :CosService.php
* @author :lyh
* @time :2023/7/19 15:09
... ...