12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- namespace app\company\controller;
- use app\common\controller\Apic;
- use think\Db;
- /**
- * 轮播图
- */
- class Usercenter extends Apic
- {
- protected $noNeedLogin = [''];
- protected $noNeedRight = [''];
- //信息维护
- public function company_info(){
- $banner = Db::name('banner')->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();
- }
- }
|