正在显示
4 个修改的文件
包含
13 行增加
和
3 行删除
| @@ -278,7 +278,7 @@ class FileController | @@ -278,7 +278,7 @@ class FileController | ||
| 278 | $projectModel = new Project(); | 278 | $projectModel = new Project(); |
| 279 | $project_info = $projectModel->read(['id' => $this->cache['project_id']], ['project_location']); | 279 | $project_info = $projectModel->read(['id' => $this->cache['project_id']], ['project_location']); |
| 280 | if ($project_info['project_location'] == 0) {//不为普通项目时 上传到本地服务器 | 280 | if ($project_info['project_location'] == 0) {//不为普通项目时 上传到本地服务器 |
| 281 | - $this->upload_location = 1;//上传到cos | 281 | + $this->upload_location = 1;//1:上传到本地 |
| 282 | } | 282 | } |
| 283 | } | 283 | } |
| 284 | $this->path = $this->uploads['path_b'].'/'.$this->cache['project_id'].'/'.$this->file_type[$this->param['refer']].'/'.date('Y-m'); | 284 | $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 | @@ -58,6 +58,7 @@ class ProductLogic extends BaseLogic | ||
| 58 | foreach ($info['keyword_id'] as $keyword_id){ | 58 | foreach ($info['keyword_id'] as $keyword_id){ |
| 59 | $info['keyword_id_text'][] =(new KeywordLogic())->getCacheInfo($keyword_id)['title']??''; | 59 | $info['keyword_id_text'][] =(new KeywordLogic())->getCacheInfo($keyword_id)['title']??''; |
| 60 | } | 60 | } |
| 61 | + $info['product_type_text'] = $this->model->productType[$info['product_type']]; | ||
| 61 | $info['category_id_text'] = Arr::arrToSet($info['category_id_text'], 'trim'); | 62 | $info['category_id_text'] = Arr::arrToSet($info['category_id_text'], 'trim'); |
| 62 | $info['keyword_id_text'] = Arr::arrToSet($info['keyword_id_text'], 'trim'); | 63 | $info['keyword_id_text'] = Arr::arrToSet($info['keyword_id_text'], 'trim'); |
| 63 | $info['status_text'] = Product::statusMap()[$info['status']] ?? ''; | 64 | $info['status_text'] = Product::statusMap()[$info['status']] ?? ''; |
| @@ -32,6 +32,15 @@ class Product extends Base | @@ -32,6 +32,15 @@ class Product extends Base | ||
| 32 | ]; | 32 | ]; |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | + /** | ||
| 36 | + * @var 获取产品类型 | ||
| 37 | + */ | ||
| 38 | + public $productType = [ | ||
| 39 | + 1=>'一般产品', | ||
| 40 | + 2=>'推荐产品', | ||
| 41 | + 3=>'热销产品' | ||
| 42 | + ]; | ||
| 43 | + | ||
| 35 | public function setThumbAttribute($value){ | 44 | public function setThumbAttribute($value){ |
| 36 | $this->attributes['thumb'] = Arr::a2s($value); | 45 | $this->attributes['thumb'] = Arr::a2s($value); |
| 37 | } | 46 | } |
| @@ -4,7 +4,7 @@ namespace App\Services; | @@ -4,7 +4,7 @@ namespace App\Services; | ||
| 4 | 4 | ||
| 5 | use Qcloud\Cos\Client; | 5 | use Qcloud\Cos\Client; |
| 6 | /** | 6 | /** |
| 7 | - * @remark : | 7 | + * @remark :对象存储cos |
| 8 | * @class :CosService.php | 8 | * @class :CosService.php |
| 9 | * @author :lyh | 9 | * @author :lyh |
| 10 | * @time :2023/7/19 15:09 | 10 | * @time :2023/7/19 15:09 |
| @@ -60,5 +60,5 @@ class CosService | @@ -60,5 +60,5 @@ class CosService | ||
| 60 | $imageUrl = $cosClient->getObjectUrl($cos['bucket'], trim($image_name,'/'), '+10 years'); | 60 | $imageUrl = $cosClient->getObjectUrl($cos['bucket'], trim($image_name,'/'), '+10 years'); |
| 61 | return $imageUrl; | 61 | return $imageUrl; |
| 62 | } | 62 | } |
| 63 | - | 63 | + |
| 64 | } | 64 | } |
-
请 注册 或 登录 后发表评论