正在显示
2 个修改的文件
包含
33 行增加
和
0 行删除
@@ -8,6 +8,8 @@ use app\mobile\model\Exam; | @@ -8,6 +8,8 @@ use app\mobile\model\Exam; | ||
8 | use app\mobile\model\UserExam; | 8 | use app\mobile\model\UserExam; |
9 | use app\mobile\model\CompanyUser; | 9 | use app\mobile\model\CompanyUser; |
10 | use app\mobile\model\Message; | 10 | use app\mobile\model\Message; |
11 | +use app\mobile\model\Statistic; | ||
12 | +use think\Db; | ||
11 | 13 | ||
12 | /** | 14 | /** |
13 | * 首页接口 | 15 | * 首页接口 |
@@ -257,4 +259,35 @@ class Index extends Api | @@ -257,4 +259,35 @@ class Index extends Api | ||
257 | ]); | 259 | ]); |
258 | $this->success('加入企业成功'); | 260 | $this->success('加入企业成功'); |
259 | } | 261 | } |
262 | + | ||
263 | + /** | ||
264 | + * @ApiTitle (启动页) | ||
265 | + * @ApiSummary (启动页) | ||
266 | + * @ApiMethod (POST) | ||
267 | + * | ||
268 | + * @ApiReturn({ | ||
269 | + "code": 1, | ||
270 | + "msg": "成功", | ||
271 | + "time": "1606398386", | ||
272 | + "data": { | ||
273 | + "url": "http://qizhibang.brotop.cn/uploads/20200811/b9bbd60dcacbcb649579155f63b62558.png" //启动页图片地址 | ||
274 | + } | ||
275 | + }) | ||
276 | + */ | ||
277 | + public function startupPage() | ||
278 | + { | ||
279 | + $url = Db::name('mobile_config')->where('id',1)->value('startup_page'); | ||
280 | + $url = cdnurl($url,true); | ||
281 | + // 记录每日启动次数 | ||
282 | + $statistic = Statistic::where('today',date('Y-m-d'))->find(); | ||
283 | + if($statistic){ | ||
284 | + $statistic->save(['startup_times' => $statistic->startup_times+1]); | ||
285 | + }else{ | ||
286 | + (new Statistic)->save([ | ||
287 | + 'startup_times' => 1, | ||
288 | + 'today' => date('Y-m-d') | ||
289 | + ]); | ||
290 | + } | ||
291 | + $this->success('成功',compact('url')); | ||
292 | + } | ||
260 | } | 293 | } |
此 diff 太大无法显示。
-
请 注册 或 登录 后发表评论