Index.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. $out_trade_no = 'SMS167817045828';
  47. $smslog_model= new Smsorder();
  48. $user_model = new \app\admin\model\User();
  49. $number = $smslog_model->where('order_no',$out_trade_no)->field('number,user_id')->find();
  50. $user_number = $user_model->where('id',$number['user_id'])->value('sms_number');
  51. $smslog_model->isUpdate('true',['order_no'=>$out_trade_no])->save(['status'=>1]);
  52. }
  53. /**
  54. * 各种协议
  55. * @ApiMethod (GET)
  56. * @ApiParams (name=id,type="int", required=true,description="协议编号:1=渔播报用户协议,2=渔场主服务协议")
  57. * @ApiReturn ({"code":1,"msg":"用户协议","time":"1672648060","data":{"id":2,"title":"渔场主服务协议","content":"渔场主服务协议渔场主服务协议渔场主服务协议渔场主服务协议"}})
  58. */
  59. public function agreement()
  60. {
  61. $id = input('id');
  62. if(!$id){
  63. $this->error('参数错误');
  64. }
  65. $xitong_model = new Xitong();
  66. $info = $xitong_model->where('id',$id)->find();
  67. $this->success('用户协议',$info);
  68. }
  69. public function xieyi()
  70. {
  71. $xitong_model = new Xitong();
  72. $info = $xitong_model->where('id',1)->find();
  73. $this->success('用户协议',$info);
  74. }
  75. }