正在显示
5 个修改的文件
包含
18 行增加
和
18 行删除
@@ -64,7 +64,7 @@ class CoachIndexController extends RestBaseController | @@ -64,7 +64,7 @@ class CoachIndexController extends RestBaseController | ||
64 | $this->error('您的申请正在审核中'); | 64 | $this->error('您的申请正在审核中'); |
65 | } | 65 | } |
66 | Db::name('coach_class_apply')->insert(['coach_id'=>$coach['id'],'class_id'=>$class['id'],'status'=>0,'create_time'=>time()]); | 66 | Db::name('coach_class_apply')->insert(['coach_id'=>$coach['id'],'class_id'=>$class['id'],'status'=>0,'create_time'=>time()]); |
67 | - $this->success('操作成功'); | 67 | + $this->success('申请成功'); |
68 | } | 68 | } |
69 | 69 | ||
70 | /** | 70 | /** |
@@ -29,7 +29,7 @@ class CoachPlanController extends RestBaseController | @@ -29,7 +29,7 @@ class CoachPlanController extends RestBaseController | ||
29 | $param = $this->request->param(); | 29 | $param = $this->request->param(); |
30 | $where=[]; | 30 | $where=[]; |
31 | if (!empty($param['time'])) { | 31 | if (!empty($param['time'])) { |
32 | - $where['c.start_time'] = [['>= time', $param['time']], ['<= time', strtotime('+1 month', $param['time'])]]; | 32 | + $where['c.start_time'] = [['>= time', intval($param['time'])], ['<= time', strtotime('+1 month', $param['time'])]]; |
33 | } else { | 33 | } else { |
34 | $where['c.start_time'] = [['>= time', strtotime('+1 month', strtotime(date('Y-m', time())))], ['<= time', strtotime('+2 month', strtotime(date('Y-m', time())))]]; | 34 | $where['c.start_time'] = [['>= time', strtotime('+1 month', strtotime(date('Y-m', time())))], ['<= time', strtotime('+2 month', strtotime(date('Y-m', time())))]]; |
35 | } | 35 | } |
@@ -421,11 +421,11 @@ class CoachPlanController extends RestBaseController | @@ -421,11 +421,11 @@ class CoachPlanController extends RestBaseController | ||
421 | $coach=Db::name('coach')->where('user_id',$userId)->find(); | 421 | $coach=Db::name('coach')->where('user_id',$userId)->find(); |
422 | $param = $this->request->param(); | 422 | $param = $this->request->param(); |
423 | $where=[]; | 423 | $where=[]; |
424 | -// if (!empty($param['time'])) { | ||
425 | -// $where['c.start_time'] = [['>= time', $param['time']], ['<= time', strtotime('+1 month', $param['time'])]]; | ||
426 | -// } else { | ||
427 | -// $where['c.start_time'] = [['>= time', strtotime('+1 month', strtotime(date('Y-m', time())))], ['<= time', strtotime('+2 month', strtotime(date('Y-m', time())))]]; | ||
428 | -// } | 424 | + if (!empty($param['time'])) { |
425 | + $where['c.start_time'] = [['>= time', intval($param['time'])], ['<= time', strtotime('+1 month', $param['time'])]]; | ||
426 | + } else { | ||
427 | + $where['c.start_time'] = [['>= time', strtotime('+1 month', strtotime(date('Y-m', time())))], ['<= time', strtotime('+2 month', strtotime(date('Y-m', time())))]]; | ||
428 | + } | ||
429 | $data=Db::name('coach_class_apply') | 429 | $data=Db::name('coach_class_apply') |
430 | ->alias('cca') | 430 | ->alias('cca') |
431 | ->join('class c','cca.class_id=c.id') | 431 | ->join('class c','cca.class_id=c.id') |
@@ -27,11 +27,11 @@ class PlanClassController extends RestBaseController | @@ -27,11 +27,11 @@ class PlanClassController extends RestBaseController | ||
27 | $userId = $this->getUserId(); | 27 | $userId = $this->getUserId(); |
28 | $param = $this->request->param(); | 28 | $param = $this->request->param(); |
29 | $where=[]; | 29 | $where=[]; |
30 | -// if (!empty($param['time'])) { | ||
31 | -// $where['c.start_time'] = [['>= time', $param['time']], ['<= time', strtotime('+1 month', $param['time'])]]; | ||
32 | -// } else { | ||
33 | -// $where['c.start_time'] = [['>= time', strtotime('+1 month', strtotime(date('Y-m', time())))], ['<= time', strtotime('+2 month', strtotime(date('Y-m', time())))]]; | ||
34 | -// } | 30 | + if (!empty($param['time'])) { |
31 | + $where['c.start_time'] = [['>= time', intval($param['time'])], ['<= time', strtotime('+1 month', $param['time'])]]; | ||
32 | + } else { | ||
33 | + $where['c.start_time'] = [['>= time', strtotime('+1 month', strtotime(date('Y-m', time())))], ['<= time', strtotime('+2 month', strtotime(date('Y-m', time())))]]; | ||
34 | + } | ||
35 | 35 | ||
36 | 36 | ||
37 | $data=Db::name('user_class_apply') | 37 | $data=Db::name('user_class_apply') |
@@ -27,7 +27,7 @@ class PlanController extends RestBaseController | @@ -27,7 +27,7 @@ class PlanController extends RestBaseController | ||
27 | $param = $this->request->param(); | 27 | $param = $this->request->param(); |
28 | $where=[]; | 28 | $where=[]; |
29 | if (!empty($param['time'])) { | 29 | if (!empty($param['time'])) { |
30 | - $where['c.start_time'] = [['>= time', $param['time']], ['<= time', strtotime('+1 month', $param['time'])]]; | 30 | + $where['c.start_time'] = [['>= time', intval($param['time'])], ['<= time', strtotime('+1 month', $param['time'])]]; |
31 | } else { | 31 | } else { |
32 | $where['c.start_time'] = [['>= time', strtotime('+1 month', strtotime(date('Y-m', time())))], ['<= time', strtotime('+2 month', strtotime(date('Y-m', time())))]]; | 32 | $where['c.start_time'] = [['>= time', strtotime('+1 month', strtotime(date('Y-m', time())))], ['<= time', strtotime('+2 month', strtotime(date('Y-m', time())))]]; |
33 | } | 33 | } |
@@ -109,11 +109,11 @@ class UserController extends RestBaseController | @@ -109,11 +109,11 @@ class UserController extends RestBaseController | ||
109 | $param = $this->request->param(); | 109 | $param = $this->request->param(); |
110 | $user=Db::name('user')->where('id',$param['user_id'])->find(); | 110 | $user=Db::name('user')->where('id',$param['user_id'])->find(); |
111 | $where=[]; | 111 | $where=[]; |
112 | -// if (!empty($param['time'])) { | ||
113 | -// $where['c.start_time'] = [['>= time', $param['time']], ['<= time', strtotime('+1 month', $param['time'])]]; | ||
114 | -// } else { | ||
115 | -// $where['c.start_time'] = [['>= time', strtotime('+1 month', strtotime(date('Y-m', time())))], ['<= time', strtotime('+2 month', strtotime(date('Y-m', time())))]]; | ||
116 | -// } | 112 | + if (!empty($param['time'])) { |
113 | + $where['c.start_time'] = [['>= time', intval($param['time'])], ['<= time', strtotime('+1 month', $param['time'])]]; | ||
114 | + } else { | ||
115 | + $where['c.start_time'] = [['>= time', strtotime('+1 month', strtotime(date('Y-m', time())))], ['<= time', strtotime('+2 month', strtotime(date('Y-m', time())))]]; | ||
116 | + } | ||
117 | 117 | ||
118 | 118 | ||
119 | $data=Db::name('user_class_apply') | 119 | $data=Db::name('user_class_apply') |
-
请 注册 或 登录 后发表评论