error('内容不能为空'); } if(!empty($images) && strpos($images,',')){ if(count(explode(',',$images)) > 8){ $this->error('一次最多只能上传9张图片'); } } $data = [ 'user_id' => $this->auth->id, 'type' => $type, 'content' => $content, 'images' => $images, 'mobile' => $mobile, 'createtime' => time(), 'updatetime' => time(), ]; $id = Db::name('feedback')->insertGetId($data); $this->success(); } //我提出的建议 public function lists(){ $list = Db::name('feedback')->where('user_id',$this->auth->id)->order('id desc')->autopage()->select(); $list = list_domain_image($list,['images']); $this->success('success',$list); } }