Index.php 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. $total_fee = ((22.02 - 20/ config('site.score_cash_offset') ) > 0 ?(22.02 - 20/ config('site.score_cash_offset') ): 0);
  47. print_r($total_fee);
  48. }
  49. /**
  50. * 各种协议
  51. * @ApiMethod (GET)
  52. * @ApiParams (name=id,type="int", required=true,description="协议编号:1=渔播报用户协议,2=渔场主服务协议")
  53. * @ApiReturn ({"code":1,"msg":"用户协议","time":"1672648060","data":{"id":2,"title":"渔场主服务协议","content":"渔场主服务协议渔场主服务协议渔场主服务协议渔场主服务协议"}})
  54. */
  55. public function agreement()
  56. {
  57. $id = input('id');
  58. if(!$id){
  59. $this->error('参数错误');
  60. }
  61. $xitong_model = new Xitong();
  62. $info = $xitong_model->where('id',$id)->find();
  63. $this->success('用户协议',$info);
  64. }
  65. public function xieyi()
  66. {
  67. $xitong_model = new Xitong();
  68. $info = $xitong_model->where('id',1)->find();
  69. $this->success('用户协议',$info);
  70. }
  71. }