更新学校
This commit is contained in:
@@ -228,6 +228,12 @@ class Group extends Backend
|
||||
//根据等级直接分配权限
|
||||
$params['rules'] = $this->rules[$params['level']];
|
||||
if ($params) {
|
||||
if($params['level'] == 4){
|
||||
//学校
|
||||
db('student')->where('group_id',$ids)->update(array('school'=>$params['name']));
|
||||
}
|
||||
|
||||
|
||||
Db::startTrans();
|
||||
try {
|
||||
$row->save($params);
|
||||
|
||||
@@ -136,6 +136,7 @@ class Student extends Backend
|
||||
$area_encoded = db('area')->where('id', $info['city'])->find();
|
||||
|
||||
$params['city'] = $area_encoded['name'];
|
||||
|
||||
$result = $this->model->validateFailException()->validate('Student.add')->allowField(true)->save($params);
|
||||
Db::commit();
|
||||
} catch (ValidateException|PDOException|Exception $e) {
|
||||
@@ -204,6 +205,7 @@ function getPicUrl($url)
|
||||
'mobile' => 'regex:1[3-9]\d{9}|unique:student,mobile,' . $row->id,
|
||||
]);
|
||||
$params['avatar'] = $this->getPicUrl($params['avatar']);
|
||||
// dump($params);die;
|
||||
$result = $row->validateFailException()->validate('Student.edit')->allowField(true)->save($params);
|
||||
Db::commit();
|
||||
} catch (ValidateException|PDOException|Exception $e) {
|
||||
|
||||
Reference in New Issue
Block a user