Tiaoshiweixiu.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. namespace app\api\controller\worker;
  3. use app\common\controller\Apiw;
  4. use think\Db;
  5. /**
  6. * 调试维修
  7. */
  8. class Tiaoshiweixiu extends Apiw
  9. {
  10. protected $noNeedLogin = [''];
  11. protected $noNeedRight = [''];
  12. public function index()
  13. {
  14. $info['title'] = '消防产品接线调试技术指导汇总';
  15. $info['createtime'] = time();
  16. //所有logo
  17. $list = Db::name('tiaoshiweixiu_logo')
  18. ->where('company_id',$this->auth->company_id)
  19. ->order('id' , 'asc')
  20. ->select();
  21. if(!empty($list)){
  22. $list = list_domain_image($list,['image']);
  23. $info['createtime'] = $list[count($list)-1]['updatetime'];
  24. }
  25. $rs = [
  26. 'info' => $info,
  27. 'list' => $list
  28. ];
  29. $this->success(1, $rs);
  30. }
  31. //操作规范
  32. public function lists(){
  33. $logo_id = input('logo_id',0);
  34. $logo_title = Db::name('tiaoshiweixiu_logo')
  35. ->where('id',$logo_id)->value('title');
  36. $info['title'] = $logo_title.':消防产品接线调试技术指导汇总';
  37. $info['createtime'] = time();
  38. //
  39. $list = Db::name('tiaoshiweixiu')->field('content',true)
  40. ->where('company_id',$this->auth->company_id)
  41. ->where('logo_id',$logo_id)
  42. ->select();
  43. if(!empty($list)){
  44. foreach($list as $key => $val){
  45. $list[$key]['title'] = $logo_title.':'.$val['title'];
  46. }
  47. $info['createtime'] = $list[count($list)-1]['updatetime'];
  48. }
  49. $rs = [
  50. 'info' => $info,
  51. 'list' => $list,
  52. ];
  53. $this->success(1, $rs);
  54. }
  55. //详情
  56. public function info(){
  57. $id = input('id',0);
  58. $info = Db::name('tiaoshiweixiu')
  59. ->where('id',$id)
  60. ->find();
  61. $logo_title = Db::name('tiaoshiweixiu_logo')
  62. ->where('id',$info['logo_id'])->value('title');
  63. $info['title'] = $logo_title.':'.$info['title'];
  64. $this->success(1, $info);
  65. }
  66. }