...
|
...
|
@@ -116,25 +116,25 @@ class LoginController extends HomeBaseController |
|
|
*/
|
|
|
public function chooseAge() {
|
|
|
if (cmf_is_user_login()) {
|
|
|
if(!session('baby_age')) {
|
|
|
$baby_model = new BabyModel();
|
|
|
$where = [
|
|
|
'delete_time' => 0
|
|
|
// if(!session('baby_age')) {
|
|
|
$baby_model = new BabyModel();
|
|
|
$where = [
|
|
|
'delete_time' => 0
|
|
|
];
|
|
|
$list = [];
|
|
|
$babyList = $baby_model->where($where)->select();
|
|
|
foreach ($babyList as $kg=>$vg) {
|
|
|
$info = [
|
|
|
'label' => $vg['age'],
|
|
|
'value' => $vg['id']
|
|
|
];
|
|
|
$list = [];
|
|
|
$babyList = $baby_model->where($where)->select();
|
|
|
foreach ($babyList as $kg=>$vg) {
|
|
|
$info = [
|
|
|
'label' => $vg['age'],
|
|
|
'value' => $vg['id']
|
|
|
];
|
|
|
$list[] = $info;
|
|
|
}
|
|
|
$this->assign('babyList',json_encode($list));
|
|
|
return $this->fetch(':choose');
|
|
|
} else {
|
|
|
return redirect($this->request->root() . '/');
|
|
|
$list[] = $info;
|
|
|
}
|
|
|
$this->assign('babyList',json_encode($list));
|
|
|
return $this->fetch(':choose');
|
|
|
// } else {
|
|
|
// return redirect($this->request->root() . '/');
|
|
|
// }
|
|
|
} else {
|
|
|
return redirect($this->request->root() . '/');
|
|
|
}
|
...
|
...
|
|