作者 潘浩文
1 个管道 的构建 失败 耗费 0 秒

测试

... ... @@ -64,7 +64,7 @@ class CoachIndexController extends RestBaseController
$this->error('您的申请正在审核中');
}
Db::name('coach_class_apply')->insert(['coach_id'=>$coach['id'],'class_id'=>$class['id'],'status'=>0,'create_time'=>time()]);
$this->success('操作成功');
$this->success('申请成功');
}
/**
... ...
... ... @@ -29,7 +29,7 @@ class CoachPlanController extends RestBaseController
$param = $this->request->param();
$where=[];
if (!empty($param['time'])) {
$where['c.start_time'] = [['>= time', $param['time']], ['<= time', strtotime('+1 month', $param['time'])]];
$where['c.start_time'] = [['>= time', intval($param['time'])], ['<= time', strtotime('+1 month', $param['time'])]];
} else {
$where['c.start_time'] = [['>= time', strtotime('+1 month', strtotime(date('Y-m', time())))], ['<= time', strtotime('+2 month', strtotime(date('Y-m', time())))]];
}
... ... @@ -421,11 +421,11 @@ class CoachPlanController extends RestBaseController
$coach=Db::name('coach')->where('user_id',$userId)->find();
$param = $this->request->param();
$where=[];
// if (!empty($param['time'])) {
// $where['c.start_time'] = [['>= time', $param['time']], ['<= time', strtotime('+1 month', $param['time'])]];
// } else {
// $where['c.start_time'] = [['>= time', strtotime('+1 month', strtotime(date('Y-m', time())))], ['<= time', strtotime('+2 month', strtotime(date('Y-m', time())))]];
// }
if (!empty($param['time'])) {
$where['c.start_time'] = [['>= time', intval($param['time'])], ['<= time', strtotime('+1 month', $param['time'])]];
} else {
$where['c.start_time'] = [['>= time', strtotime('+1 month', strtotime(date('Y-m', time())))], ['<= time', strtotime('+2 month', strtotime(date('Y-m', time())))]];
}
$data=Db::name('coach_class_apply')
->alias('cca')
->join('class c','cca.class_id=c.id')
... ...
... ... @@ -27,11 +27,11 @@ class PlanClassController extends RestBaseController
$userId = $this->getUserId();
$param = $this->request->param();
$where=[];
// if (!empty($param['time'])) {
// $where['c.start_time'] = [['>= time', $param['time']], ['<= time', strtotime('+1 month', $param['time'])]];
// } else {
// $where['c.start_time'] = [['>= time', strtotime('+1 month', strtotime(date('Y-m', time())))], ['<= time', strtotime('+2 month', strtotime(date('Y-m', time())))]];
// }
if (!empty($param['time'])) {
$where['c.start_time'] = [['>= time', intval($param['time'])], ['<= time', strtotime('+1 month', $param['time'])]];
} else {
$where['c.start_time'] = [['>= time', strtotime('+1 month', strtotime(date('Y-m', time())))], ['<= time', strtotime('+2 month', strtotime(date('Y-m', time())))]];
}
$data=Db::name('user_class_apply')
... ...
... ... @@ -27,7 +27,7 @@ class PlanController extends RestBaseController
$param = $this->request->param();
$where=[];
if (!empty($param['time'])) {
$where['c.start_time'] = [['>= time', $param['time']], ['<= time', strtotime('+1 month', $param['time'])]];
$where['c.start_time'] = [['>= time', intval($param['time'])], ['<= time', strtotime('+1 month', $param['time'])]];
} else {
$where['c.start_time'] = [['>= time', strtotime('+1 month', strtotime(date('Y-m', time())))], ['<= time', strtotime('+2 month', strtotime(date('Y-m', time())))]];
}
... ...
... ... @@ -109,11 +109,11 @@ class UserController extends RestBaseController
$param = $this->request->param();
$user=Db::name('user')->where('id',$param['user_id'])->find();
$where=[];
// if (!empty($param['time'])) {
// $where['c.start_time'] = [['>= time', $param['time']], ['<= time', strtotime('+1 month', $param['time'])]];
// } else {
// $where['c.start_time'] = [['>= time', strtotime('+1 month', strtotime(date('Y-m', time())))], ['<= time', strtotime('+2 month', strtotime(date('Y-m', time())))]];
// }
if (!empty($param['time'])) {
$where['c.start_time'] = [['>= time', intval($param['time'])], ['<= time', strtotime('+1 month', $param['time'])]];
} else {
$where['c.start_time'] = [['>= time', strtotime('+1 month', strtotime(date('Y-m', time())))], ['<= time', strtotime('+2 month', strtotime(date('Y-m', time())))]];
}
$data=Db::name('user_class_apply')
... ...