|
...
|
...
|
@@ -33,12 +33,29 @@ class NewsCategoryLogic extends BaseLogic |
|
|
|
$info = $this->model->read($this->param);
|
|
|
|
$info['url'] = $this->user['domain'] . $info['alias'];
|
|
|
|
if(!empty($info['banner_image'])){
|
|
|
|
$info['banner_image_link'] = getImageUrl($info['banner_image'],$this->user['storage_type'] ?? 0,$this->user['project_location']);
|
|
|
|
$info['banner_image'] = getImageUrl($info['banner_image'],$this->user['storage_type'] ?? 0,$this->user['project_location']);
|
|
|
|
}
|
|
|
|
return $this->success($info);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :保存处理字段
|
|
|
|
* @name :handleParam
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/9/13 9:15
|
|
|
|
*/
|
|
|
|
public function handleParam($param)
|
|
|
|
{
|
|
|
|
if(isset($param['banner_image']) && !empty($param['banner_image'])){
|
|
|
|
$param['banner_image'] = str_replace_url($param['banner_image']);
|
|
|
|
}
|
|
|
|
if(isset($param['image']) && !empty($param['image'])){
|
|
|
|
$param['image'] = str_replace_url($param['image']);
|
|
|
|
}
|
|
|
|
return $this->success($param);
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @remark :保存数据
|
|
|
|
* @name :newsCategorySave
|
|
|
|
* @author :lyh
|
|
...
|
...
|
@@ -48,6 +65,7 @@ class NewsCategoryLogic extends BaseLogic |
|
|
|
public function newsCategorySave(){
|
|
|
|
//验证名称是否存在
|
|
|
|
$this->verifyParamName($this->param['name']);
|
|
|
|
$this->param = $this->handleParam($this->param);
|
|
|
|
DB::beginTransaction();
|
|
|
|
try {
|
|
|
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
...
|
...
|
|