作者 何书鹏
1 个管道 的构建 通过 耗费 1 秒

启动页

... ... @@ -8,6 +8,8 @@ use app\mobile\model\Exam;
use app\mobile\model\UserExam;
use app\mobile\model\CompanyUser;
use app\mobile\model\Message;
use app\mobile\model\Statistic;
use think\Db;
/**
* 首页接口
... ... @@ -257,4 +259,35 @@ class Index extends Api
]);
$this->success('加入企业成功');
}
/**
* @ApiTitle (启动页)
* @ApiSummary (启动页)
* @ApiMethod (POST)
*
* @ApiReturn({
"code": 1,
"msg": "成功",
"time": "1606398386",
"data": {
"url": "http://qizhibang.brotop.cn/uploads/20200811/b9bbd60dcacbcb649579155f63b62558.png" //启动页图片地址
}
})
*/
public function startupPage()
{
$url = Db::name('mobile_config')->where('id',1)->value('startup_page');
$url = cdnurl($url,true);
// 记录每日启动次数
$statistic = Statistic::where('today',date('Y-m-d'))->find();
if($statistic){
$statistic->save(['startup_times' => $statistic->startup_times+1]);
}else{
(new Statistic)->save([
'startup_times' => 1,
'today' => date('Y-m-d')
]);
}
$this->success('成功',compact('url'));
}
}
\ No newline at end of file
... ...
此 diff 太大无法显示。