作者 lyh

gx

... ... @@ -10,6 +10,7 @@ use App\Http\Controllers\File\ImageController;
use App\Http\Logic\Aside\Project\ProjectLogic;
use App\Http\Logic\Logic;
use App\Models\File\Image as ImageModel;
use App\Models\Project\Project;
use App\Models\UpdateNotify;
use Illuminate\Support\Facades\Cache;
... ... @@ -36,10 +37,25 @@ class BaseLogic extends Logic
$this->request = request();
$this->requestAll = request()->all();
$this->user = Cache::get(request()->header('token'));
$this->project = (new ProjectLogic())->getInfo($this->user['project_id']);
$this->project = $this->getProjectInfo($this->user['project_id']);
}
/**
* @remark :获取项目数据详情
* @name :getProjectInfo
* @author :lyh
* @method :post
* @time :2023/8/17 10:20
*/
public function getProjectInfo($id){
$projectModel = new Project();
$info = $projectModel->with('payment')->with('deploy_build')
->with('deploy_optimize')->with('online_check')->where(['id'=>$id])->first();
if($info['extend_type'] != 0){
$info['type'] = $info['extend_type'];
}
return $this->success($info);
}
/**
* 列表
* @param array $map
... ...
... ... @@ -32,7 +32,6 @@ class ProductLogic extends BaseLogic
$data = parent::getList($map, $sort, $columns, $row);
foreach ($data['list'] as &$v){
$v = $this->formatData($v);
$v['thumb']['image_link'] = getImageUrl($v['thumb']['url']);//图片统一
}
return $this->success($data);
}
... ... @@ -41,14 +40,6 @@ class ProductLogic extends BaseLogic
{
$info = $this->model->read(['id'=>$id]);
$info = $this->formatData($info);
//统一图片链接
if(!empty($info['gallery'])){
foreach ($info['gallery'] as $k => $v){
$v['image_link'] = getImageUrl($v['url']);
$info['gallery'][$k] = $v;
}
}
$info['icon_link'] = getImageUrl($info['icon']);
return $this->success($info);
}
... ...