Password.php 979 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace app\api\controller\worker;
  3. use app\common\controller\Apiw;
  4. use think\Db;
  5. /**
  6. * 密码
  7. */
  8. class Password extends Apiw
  9. {
  10. protected $noNeedLogin = [''];
  11. protected $noNeedRight = [''];
  12. //操作规范
  13. public function lists(){
  14. $keyword = input('keyword','','trim');
  15. $where = [
  16. 'company_id' => $this->auth->company_id
  17. ];
  18. if(!empty($keyword)){
  19. $where['brand|name|typename'] = ['LIKE','%'.$keyword.'%'];
  20. }
  21. $list = Db::name('password')
  22. ->where($where)
  23. ->autopage()
  24. ->select();
  25. $list = list_domain_image($list,['logo_image']);
  26. $this->success(1, $list);
  27. }
  28. //详情
  29. public function info(){
  30. $id = input('id',0);
  31. $info = Db::name('password')
  32. ->where('id',$id)
  33. ->find();
  34. $info = info_domain_image($info,['logo_image']);
  35. $this->success(1, $info);
  36. }
  37. }