public function actionSettle() { $id = \Yii::$app->request->get("id"); $model = new Student(); $arr = $model->settle($id); $count = count($arr['name']); $price = $count * $arr['salary']['partjob_wages']; return $this->render("settle", ["name" => $arr['name'], "salary" => $arr['salary'], "price" => $price]); }
public function actionStudentHeadPortrait() { $user = new User(); $model = new Student(); $file = new Upload(); if (Yii::$app->request->isPost) { $file->student_avatar = UploadedFile::getInstance($file, 'student_avatar'); $path = 'uploads/' . time() . rand('111', '999') . '.' . $file->student_avatar->extension; $file->student_avatar->saveAs($path); $imgUrl = $path; $model->userImg($imgUrl); //添加用户头像 } $userInfo = $user->getUser(1); return $this->render('studentheadportrait', ['model' => $model, 'file' => $file, 'userInfo' => $userInfo]); }