作者 lyh

gx

@@ -35,6 +35,12 @@ class AiBlogController extends BaseController @@ -35,6 +35,12 @@ class AiBlogController extends BaseController
35 */ 35 */
36 public function getAiBlog(AiBlog $aiBlog){ 36 public function getAiBlog(AiBlog $aiBlog){
37 $lists = $aiBlog->lists($this->map,$this->page,$this->row,'id',['id','new_title','task_id','status','created_at','updated_at']); 37 $lists = $aiBlog->lists($this->map,$this->page,$this->row,'id',['id','new_title','task_id','status','created_at','updated_at']);
  38 + if(!empty($lists) && !empty($lists['list'])){
  39 + foreach ($lists['list'] as $k => $v){
  40 + $v['image'] = getImageUrl($v['url'],$this->user['storage_type'],$this->user['project_location']);
  41 + $lists['list'][$k] = $v;
  42 + }
  43 + }
38 $this->response('success',Code::SUCCESS,$lists); 44 $this->response('success',Code::SUCCESS,$lists);
39 } 45 }
40 46
@@ -28,8 +28,11 @@ class AiBlogLogic extends BaseLogic @@ -28,8 +28,11 @@ class AiBlogLogic extends BaseLogic
28 * @time :2023/7/5 14:46 28 * @time :2023/7/5 14:46
29 */ 29 */
30 public function blogSave(){ 30 public function blogSave(){
31 - $this->param['project_id'] = $this->user['project_id'];  
32 - $rs = $this->model->add($this->param); 31 + if(!empty($this->param['image'])){
  32 + $this->param['image'] = str_replace_url($this->param['image']);
  33 + }
  34 + $this->param['route'] = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT, $this->param['id'], $this->user['project_id']);
  35 + $rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
33 if($rs === false){ 36 if($rs === false){
34 $this->fail('error'); 37 $this->fail('error');
35 } 38 }