// +---------------------------------------------------------------------- namespace app\matchmaker\controller; use app\matchmaker\model\MatchmakerModel; use app\matchmaker\model\MatchmakerUserModel; class MyController extends MatchmakerBaseController { public function index() { $data['matchmaker'] = $this->matchmaker; $data['matchmaker']['avatar'] = cmf_get_image_url($data['matchmaker']['avatar']); return $this->fetch('', $data); } public function info() { $data['matchmaker'] = $this->matchmaker; $data['matchmaker']['avatar'] = cmf_get_image_url($data['matchmaker']['avatar']); return $this->fetch('', $data); } public function infoPost() { $data = $this->request->post(); MatchmakerModel::update($data); $this->success(); } public function statistics() { $data = []; $data['total'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id) ->count(); $data['sex_man'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id) ->where('sex', 1) ->count(); $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) ->where('education', '本科') ->count(); $data['education_ss'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id) ->where('education', '硕士') ->count(); $data['education_bs'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id) ->where('education', '博士') ->count(); $data['marry_wh'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id) ->where('marry', '未婚') ->count(); $data['marry_lh'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id) ->where('marry', '离婚') ->count(); $data['marry_so'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id) ->where('marry', '丧偶') ->count(); $data['status_1'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id) ->where('status', 1) ->count(); $data['status_2'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id) ->where('status', 2) ->count(); $data['status_3'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id) ->where('status', 3) ->count(); $data['status_4'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id) ->where('status', 4) ->count(); $data['status_5'] = MatchmakerUserModel::where('matchmaker_id', $this->matchmaker->id) ->where('status', 5) ->count(); return view('',$data); } }