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

合并分支 '1iuzhen' 到 'master'

选择宝宝年龄段逻辑调整



查看合并请求 !199
@@ -116,25 +116,25 @@ class LoginController extends HomeBaseController @@ -116,25 +116,25 @@ class LoginController extends HomeBaseController
116 */ 116 */
117 public function chooseAge() { 117 public function chooseAge() {
118 if (cmf_is_user_login()) { 118 if (cmf_is_user_login()) {
119 - if(!session('baby_age')) {  
120 - $baby_model = new BabyModel();  
121 - $where = [  
122 - 'delete_time' => 0 119 +// if(!session('baby_age')) {
  120 + $baby_model = new BabyModel();
  121 + $where = [
  122 + 'delete_time' => 0
  123 + ];
  124 + $list = [];
  125 + $babyList = $baby_model->where($where)->select();
  126 + foreach ($babyList as $kg=>$vg) {
  127 + $info = [
  128 + 'label' => $vg['age'],
  129 + 'value' => $vg['id']
123 ]; 130 ];
124 - $list = [];  
125 - $babyList = $baby_model->where($where)->select();  
126 - foreach ($babyList as $kg=>$vg) {  
127 - $info = [  
128 - 'label' => $vg['age'],  
129 - 'value' => $vg['id']  
130 - ];  
131 - $list[] = $info;  
132 - }  
133 - $this->assign('babyList',json_encode($list));  
134 - return $this->fetch(':choose');  
135 - } else {  
136 - return redirect($this->request->root() . '/'); 131 + $list[] = $info;
137 } 132 }
  133 + $this->assign('babyList',json_encode($list));
  134 + return $this->fetch(':choose');
  135 +// } else {
  136 +// return redirect($this->request->root() . '/');
  137 +// }
138 } else { 138 } else {
139 return redirect($this->request->root() . '/'); 139 return redirect($this->request->root() . '/');
140 } 140 }