正在显示
1 个修改的文件
包含
47 行增加
和
0 行删除
@@ -118,4 +118,51 @@ class Update extends Api | @@ -118,4 +118,51 @@ class Update extends Api | ||
118 | $Info = Db::name('warter_content')->find(); | 118 | $Info = Db::name('warter_content')->find(); |
119 | $this->success('成功', $Info); | 119 | $this->success('成功', $Info); |
120 | } | 120 | } |
121 | + | ||
122 | + | ||
123 | + /** | ||
124 | + * 改版接口 | ||
125 | + * @ApiTitle (用户获取一张优惠券) | ||
126 | + * @ApiSummary (用户获取一张优惠券) | ||
127 | + * @ApiMethod (POST) | ||
128 | + * @ApiRoute (/api/Update/InserUserTick) | ||
129 | + * @ApiHeaders (name=token, type=string, required=true, description="请求的Token") | ||
130 | + * @ApiReturnParams (name="code", type="integer", required=true, sample="0") | ||
131 | + * @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功") | ||
132 | + * @ApiReturn ({ | ||
133 | + 'code':'1', | ||
134 | + 'msg':'返回成功', | ||
135 | + } | ||
136 | + }) | ||
137 | + */ | ||
138 | + public function InserUserTick() | ||
139 | + { | ||
140 | + $UserId = $this->is_token($this->request->header()); | ||
141 | + $TickInfo = Db::name('tick')->find(); | ||
142 | + $data = [ | ||
143 | + 'user_id' => $UserId, | ||
144 | + 'exp_time' => time() + $TickInfo['you_time'] * 86400, | ||
145 | + 'createtime' => time(), | ||
146 | + 'status' => 0 | ||
147 | + ]; | ||
148 | + $Res = Db::name('user_tick')->insert($data); | ||
149 | + $this->Res($Res); | ||
150 | + } | ||
151 | + | ||
152 | + | ||
153 | + /** | ||
154 | + * 改版接口 | ||
155 | + * @ApiTitle (下单选择优惠券页面) | ||
156 | + * @ApiSummary (下单选择优惠券页面) | ||
157 | + * @ApiMethod (POST) | ||
158 | + * @ApiRoute (/api/Update/ThinkUserTick) | ||
159 | + * @ApiHeaders (name=token, type=string, required=true, description="请求的Token") | ||
160 | + * @ApiReturnParams (name="code", type="integer", required=true, sample="0") | ||
161 | + * @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功") | ||
162 | + * @ApiReturn ({ | ||
163 | + 'code':'1', | ||
164 | + 'msg':'返回成功', | ||
165 | + } | ||
166 | + }) | ||
167 | + */ | ||
121 | } | 168 | } |
-
请 注册 或 登录 后发表评论