1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <?php
- namespace app\company\controller;
- use app\common\controller\Apic;
- use think\Db;
- /**
- * 调试维修logo
- */
- class Tiaoshiweixiulogo extends Apic
- {
- protected $noNeedLogin = [];
- protected $noNeedRight = ['info'];
- protected $table = 'tiaoshiweixiu_logo';
-
- public function index(){
- $list = Db::name($this->table)->where('company_id',$this->auth->company_id)->order('id desc')->select();
- $list = list_domain_image($list,['image']);
- $this->success(1,$list);
- }
- public function add(){
- $data = [
- 'title' => input('title',''),
- 'image' => input('image',''),
- 'company_id' => $this->auth->company_id,
- 'updatetime' => time(),
- ];
- Db::name($this->table)->insertGetId($data);
- $this->success();
- }
- public function info(){
- $id = input('id',0);
- $info = Db::name($this->table)->where('id',$id)->where('company_id',$this->auth->company_id)->find();
- $info = info_domain_image($info,['image']);
- $this->success(1,$info);
- }
- public function edit(){
- $id = input('id',0);
- $info = Db::name($this->table)->where('id',$id)->where('company_id',$this->auth->company_id)->find();
- if(empty($info)){
- $this->error('没找到该信息,请刷新重试');
- }
- $data = [
- 'title' => input('title',''),
- 'image' => input('image',''),
- 'updatetime' => time(),
- ];
- Db::name($this->table)->where('id',$id)->update($data);
- $this->success();
- }
- public function del(){
- $ids = input('ids','');
- $ids = explode(',',$ids);
- if (empty($ids)) {
- $this->error();
- }
- Db::name($this->table)->where('id','IN',$ids)->where('company_id',$this->auth->company_id)->delete();
- $this->success();
- }
- }
|