Index.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. namespace app\api\controller;
  3. use addons\epay\library\Service;
  4. use app\admin\model\Banner;
  5. use app\admin\model\method\Time;
  6. use app\admin\model\Order;
  7. use app\admin\model\Smsorder;
  8. use app\admin\model\Tzmoneylog;
  9. use app\admin\model\Tzmoneyrecharge;
  10. use app\admin\model\Xitong;
  11. use app\common\controller\Api;
  12. use think\Db;
  13. /**
  14. * 首页接口
  15. * @ApiWeigh (2)
  16. */
  17. class Index extends Api
  18. {
  19. protected $noNeedLogin = ['*'];
  20. protected $noNeedRight = ['*'];
  21. /**
  22. * 首页
  23. *
  24. */
  25. public function index()
  26. {
  27. $this->success('请求成功');
  28. }
  29. /**
  30. * 轮播图
  31. * @ApiMethod (GET)
  32. * @ApiReturnParams (name="title", type="string", required=true, description="标题")
  33. * @ApiReturnParams (name="image", type="int", required=true, description="图片")
  34. * @ApiReturnParams (name="link_mode", type="int", required=true, description="链接模块:1=商城,2=鱼塘")
  35. * @ApiReturnParams (name="link_id", type="int", required=true, description="链接模块数据id")
  36. * @ApiReturn ({"code":1,"msg":"轮播图","time":"1672134983","data":[{"id":1,"title":"图一","image":"/assets/img/qrcode.png","link_mode":1,"link_id":2,"weigh":2,"status":1,"create_time":1672134120,"update_time":1672134120,"link_mode_text":"Link_mode 1","status_text":"Status 1","create_time_text":"2022-12-27 17:42:00","update_time_text":"2022-12-27 17:42:00"},{"id":2,"title":"图二","image":"/assets/img/qrcode.png","link_mode":2,"link_id":1,"weigh":0,"status":1,"create_time":1672134825,"update_time":1672134825,"link_mode_text":"Link_mode 2","status_text":"Status 1","create_time_text":"2022-12-27 17:53:45","update_time_text":"2022-12-27 17:53:45"}]})
  37. */
  38. public function banner()
  39. {
  40. $banner = new Banner();
  41. $list = $banner->where('status', 1)->order('weigh', 'DESC')->select();
  42. $this->success('轮播图', $list);
  43. }
  44. public function ceshi()
  45. {
  46. $v = input();
  47. $sms_model =new Sms();
  48. $sms_model->order_sta($v['phone'], 17, $v['t_user_id']);
  49. }
  50. /**
  51. * 各种协议
  52. * @ApiMethod (GET)
  53. * @ApiParams (name=id,type="int", required=true,description="协议编号:1=渔播报用户协议,2=渔场主服务协议")
  54. * @ApiReturn ({"code":1,"msg":"用户协议","time":"1672648060","data":{"id":2,"title":"渔场主服务协议","content":"渔场主服务协议渔场主服务协议渔场主服务协议渔场主服务协议"}})
  55. */
  56. public function agreement()
  57. {
  58. $id = input('id');
  59. if(!$id){
  60. $this->error('参数错误');
  61. }
  62. $xitong_model = new Xitong();
  63. $info = $xitong_model->where('id',$id)->find();
  64. $this->success('用户协议',$info);
  65. }
  66. public function xieyi()
  67. {
  68. $xitong_model = new Xitong();
  69. $info = $xitong_model->where('id',1)->find();
  70. $this->success('用户协议',$info);
  71. }
  72. }