|
@@ -40,54 +40,75 @@ class MyController extends MatchmakerBaseController
|
|
|
$this->success();
|
|
|
}
|
|
|
|
|
|
+ public function password()
|
|
|
+ {
|
|
|
+ return $this->fetch();
|
|
|
+ }
|
|
|
+
|
|
|
+ public function passwordPost()
|
|
|
+ {
|
|
|
+ $data = $this->request->post();
|
|
|
+ if ($data['new_pass'] != $data['re_pass']) {
|
|
|
+ $this->error('两次密码不一致!');
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($data['old_pass'] != $this->matchmaker['password']) {
|
|
|
+ $this->error('旧密码错误!');
|
|
|
+ }
|
|
|
+
|
|
|
+ MatchmakerModel::update(['password' => $data['new_pass']], ['id' => $this->matchmaker['id']]);
|
|
|
+
|
|
|
+ $this->success();
|
|
|
+ }
|
|
|
+
|
|
|
public function statistics()
|
|
|
{
|
|
|
- $data = [];
|
|
|
- $data['total'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
+ $data = [];
|
|
|
+ $data['total'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
->count();
|
|
|
- $data['sex_man'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
+ $data['sex_man'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
->where('sex', 1)
|
|
|
->count();
|
|
|
- $data['sex_woman'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
+ $data['sex_woman'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
->where('sex', 2)
|
|
|
->count();
|
|
|
$data['education_bkyx'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
->where('education', '本科以下')
|
|
|
->count();
|
|
|
- $data['education_bk'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
+ $data['education_bk'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
->where('education', '本科')
|
|
|
->count();
|
|
|
- $data['education_ss'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
+ $data['education_ss'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
->where('education', '硕士')
|
|
|
->count();
|
|
|
- $data['education_bs'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
+ $data['education_bs'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
->where('education', '博士')
|
|
|
->count();
|
|
|
- $data['marry_wh'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
+ $data['marry_wh'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
->where('marry', '未婚')
|
|
|
->count();
|
|
|
- $data['marry_lh'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
+ $data['marry_lh'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
->where('marry', '离婚')
|
|
|
->count();
|
|
|
- $data['marry_so'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
+ $data['marry_so'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
->where('marry', '丧偶')
|
|
|
->count();
|
|
|
- $data['status_1'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
+ $data['status_1'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
->where('status', 1)
|
|
|
->count();
|
|
|
- $data['status_2'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
+ $data['status_2'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
->where('status', 2)
|
|
|
->count();
|
|
|
- $data['status_3'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
+ $data['status_3'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
->where('status', 3)
|
|
|
->count();
|
|
|
- $data['status_4'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
+ $data['status_4'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
->where('status', 4)
|
|
|
->count();
|
|
|
- $data['status_5'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
+ $data['status_5'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id)
|
|
|
->where('status', 5)
|
|
|
->count();
|
|
|
|
|
|
- return view('',$data);
|
|
|
+ return view('', $data);
|
|
|
}
|
|
|
}
|