作者 刘朕
1 个管道 的构建 通过 耗费 0 秒

选择宝宝年龄段逻辑调整

... ... @@ -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() . '/');
}
... ...