作者 anyv

5

... ... @@ -83,16 +83,22 @@ class OrderpageController extends WeChatBaseController{
$salesman = Db::name('my_user') -> where('id',$teacher['pid']) -> find();
}
//查询这个用户下添加的学校
$school = Db::name('school') -> where("uid",$uid) -> select();
$grade_class = Db::name('grade_class') -> where("school_id",$school[0]['id']) -> select();
foreach ($grade_class as $key => $val){
$class = explode('-',$val['class']);
for($i=$class[0];$i<=$class[1];$i++){
$grade_class_show[] = $val['grade'].' - '.$i."班";
$school = Db::name('school') -> where("uid",$uid) -> select() -> toArray();
if(!empty($school)){
$grade_class = Db::name('grade_class') -> where("school_id",$school[0]['id']) -> select();
foreach ($grade_class as $key => $val){
$class = explode('-',$val['class']);
for($i=$class[0];$i<=$class[1];$i++){
$grade_class_show[] = $val['grade'].' - '.$i."班";
}
}
}
$this -> assign('school',$school);
$this -> assign('grade_class_show',$grade_class_show);
$this -> assign('grade_class_show',!empty($grade_class_show) ? $grade_class_show : '');
return $this -> fetch();
}
... ...