123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <?php
- namespace app\api\controller;
- use addons\epay\library\Service;
- use app\admin\model\Banner;
- use app\admin\model\method\Time;
- use app\admin\model\Order;
- use app\admin\model\Smsorder;
- use app\admin\model\Tzmoneylog;
- use app\admin\model\Tzmoneyrecharge;
- use app\admin\model\Xitong;
- use app\common\controller\Api;
- use think\Db;
- /**
- * 首页接口
- * @ApiWeigh (2)
- */
- class Index extends Api
- {
- protected $noNeedLogin = ['*'];
- protected $noNeedRight = ['*'];
- /**
- * 首页
- *
- */
- public function index()
- {
- $this->success('请求成功');
- }
- /**
- * 轮播图
- * @ApiMethod (GET)
- * @ApiReturnParams (name="title", type="string", required=true, description="标题")
- * @ApiReturnParams (name="image", type="int", required=true, description="图片")
- * @ApiReturnParams (name="link_mode", type="int", required=true, description="链接模块:1=商城,2=鱼塘")
- * @ApiReturnParams (name="link_id", type="int", required=true, description="链接模块数据id")
- * @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"}]})
- */
- public function banner()
- {
- $banner = new Banner();
- $list = $banner->where('status', 1)->order('weigh', 'DESC')->select();
- $this->success('轮播图', $list);
- }
- public function ceshi()
- {
- $out_trade_no = 'SMS167817045828';
- $smslog_model= new Smsorder();
- $user_model = new \app\admin\model\User();
- $number = $smslog_model->where('order_no',$out_trade_no)->field('number,user_id')->find();
- $user_number = $user_model->where('id',$number['user_id'])->value('sms_number');
- $smslog_model->isUpdate('true',['order_no'=>$out_trade_no])->save(['status'=>1]);
- }
- /**
- * 各种协议
- * @ApiMethod (GET)
- * @ApiParams (name=id,type="int", required=true,description="协议编号:1=渔播报用户协议,2=渔场主服务协议")
- * @ApiReturn ({"code":1,"msg":"用户协议","time":"1672648060","data":{"id":2,"title":"渔场主服务协议","content":"渔场主服务协议渔场主服务协议渔场主服务协议渔场主服务协议"}})
- */
- public function agreement()
- {
- $id = input('id');
- if(!$id){
- $this->error('参数错误');
- }
- $xitong_model = new Xitong();
- $info = $xitong_model->where('id',$id)->find();
- $this->success('用户协议',$info);
- }
- public function xieyi()
- {
- $xitong_model = new Xitong();
- $info = $xitong_model->where('id',1)->find();
- $this->success('用户协议',$info);
- }
- }
|