|
@@ -31,6 +31,17 @@ class QuestionController extends AbstractController
|
|
|
|
|
|
//用户绑定机构
|
|
//用户绑定机构
|
|
public function bindjigou(BindjigouRequest $request){
|
|
public function bindjigou(BindjigouRequest $request){
|
|
|
|
+
|
|
|
|
+ //验证活动开始时间,结束时间
|
|
|
|
+ if( time() < strtotime(site('subject_starttime')) )
|
|
|
|
+ {
|
|
|
|
+ return AppResult::error('活动开始时间:'.site('subject_starttime'));
|
|
|
|
+ }
|
|
|
|
+ if( strtotime(site('subject_endtime')) < time() )
|
|
|
|
+ {
|
|
|
|
+ return AppResult::error('活动在'.site('subject_endtime').'就结束了');
|
|
|
|
+ }
|
|
|
|
+
|
|
$params = $request->validated();// 获取校验通过的参数
|
|
$params = $request->validated();// 获取校验通过的参数
|
|
$user = AuthUser::getInstance()->get();
|
|
$user = AuthUser::getInstance()->get();
|
|
|
|
|
|
@@ -73,6 +84,16 @@ class QuestionController extends AbstractController
|
|
*/
|
|
*/
|
|
public function submit(SubmitRequest $request)
|
|
public function submit(SubmitRequest $request)
|
|
{
|
|
{
|
|
|
|
+ //验证活动开始时间,结束时间
|
|
|
|
+ if( time() < strtotime(site('subject_starttime')) )
|
|
|
|
+ {
|
|
|
|
+ return AppResult::error('活动开始时间:'.site('subject_starttime'));
|
|
|
|
+ }
|
|
|
|
+ if( strtotime(site('subject_endtime')) < time() )
|
|
|
|
+ {
|
|
|
|
+ return AppResult::error('活动在'.site('subject_endtime').'就结束了');
|
|
|
|
+ }
|
|
|
|
+
|
|
if (!RedisUtil::getInstance(RedisKeyEnum::API_REQUEST_TRAFFIC)->tryTimes(1, 2)) {
|
|
if (!RedisUtil::getInstance(RedisKeyEnum::API_REQUEST_TRAFFIC)->tryTimes(1, 2)) {
|
|
return AppResult::error('操作太快了,休息一下吧');
|
|
return AppResult::error('操作太快了,休息一下吧');
|
|
}
|
|
}
|