where('company_id',$this->auth->company_id)->column('image'); $company = Db::name('company')->field('aboutus_image,aboutus')->where('id',$this->auth->company_id)->find(); $rs = [ 'banner' => one_domain_image(implode(',',$banner)), 'aboutus' => $company['aboutus'], 'aboutus_image' => localpath_to_netpath($company['aboutus_image']), ]; $this->success(1,$rs); } //设置轮播图,关于我们图 public function set_banner() { //轮播图 $banner_images = input('banner_images',''); Db::name('banner')->where('company_id',$this->auth->company_id)->delete(); $banner_images = explode(',',$banner_images); if(!empty($banner_images)){ foreach($banner_images as $key => $val){ $insert_all[] = [ 'image' => $val, 'company_id' => $this->auth->company_id, ]; } Db::name('banner')->insertAll($insert_all); } //关于我们图 $aboutus_image = input('aboutus_image',''); $update = ['aboutus_image'=>$aboutus_image]; Db::name('company')->where('id',$this->auth->company_id)->update($update); $this->success(); } //设置关于我们 public function set_aboutus() { $aboutus = input('aboutus','','htmlspecialchars_decode'); $update = ['aboutus'=>$aboutus]; Db::name('company')->where('id',$this->auth->company_id)->update($update); $this->success(); } }