|
@@ -172,7 +172,7 @@ class Human extends MobileBaseController
|
|
|
|
|
|
public function institutionDetail()
|
|
|
{
|
|
|
- $this->_listValidate();
|
|
|
+ $human = $this->_listValidate();
|
|
|
|
|
|
$id = input('id');
|
|
|
empty($id) && jump('该机构不存在或已删除');
|
|
@@ -180,6 +180,24 @@ class Human extends MobileBaseController
|
|
|
$info = HumanInstitutionModel::find($id);
|
|
|
empty($info) && jump('该机构不存在或已删除');
|
|
|
|
|
|
+ $apply = HumanInstitutionApplyModel::where('join_mobile', '=', $info['join_mobile'])->find();
|
|
|
+ if (!empty($apply)) {
|
|
|
+ $check = HumanSeeModel::where([
|
|
|
+ ['join_mobile', '=', $human['data']['join_mobile']],
|
|
|
+ ['human_id', '=', $apply['id']],
|
|
|
+ ['type', '=', '机构'],
|
|
|
+ ])->find();
|
|
|
+ if (empty($check)) {
|
|
|
+ HumanSeeModel::create([
|
|
|
+ 'type' => '机构',
|
|
|
+ 'human_id' => $apply['id'],
|
|
|
+ 'name' => $human['data']['name'],
|
|
|
+ 'join' => $human['data']['join'],
|
|
|
+ 'join_mobile' => $human['data']['join_mobile'],
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return view('', ['info' => $info]);
|
|
|
}
|
|
|
|
|
@@ -227,16 +245,25 @@ class Human extends MobileBaseController
|
|
|
$info = HumanEnterpriseModel::find($id);
|
|
|
empty($info) && jump('该企业不存在或已删除');
|
|
|
|
|
|
- $check = HumanSeeModel::where('join_mobile', $info['join_mobile'])->where('human_id',$info['id'])->find();
|
|
|
- if (empty($check)) {
|
|
|
- HumanSeeModel::create([
|
|
|
- 'type' => $human['type'],
|
|
|
- 'name' => $human['data']['name'],
|
|
|
- 'join' => $human['data']['join'],
|
|
|
- 'join_mobile' => $human['data']['join_mobile'],
|
|
|
- ]);
|
|
|
+ $apply = HumanEnterpriseApplyModel::where('join_mobile', '=', $info['join_mobile'])->find();
|
|
|
+ if (!empty($apply)) {
|
|
|
+ $check = HumanSeeModel::where([
|
|
|
+ ['join_mobile', '=', $human['data']['join_mobile']],
|
|
|
+ ['human_id', '=', $apply['id']],
|
|
|
+ ['type', '=', '企业'],
|
|
|
+ ])->find();
|
|
|
+ if (empty($check)) {
|
|
|
+ HumanSeeModel::create([
|
|
|
+ 'type' => '企业',
|
|
|
+ 'human_id' => $apply['id'],
|
|
|
+ 'name' => $human['data']['name'],
|
|
|
+ 'join' => $human['data']['join'],
|
|
|
+ 'join_mobile' => $human['data']['join_mobile'],
|
|
|
+ ]);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
return view('', ['info' => $info]);
|
|
|
}
|
|
|
|
|
@@ -318,6 +345,28 @@ class Human extends MobileBaseController
|
|
|
ajax_return();
|
|
|
}
|
|
|
|
|
|
+ public function seeme()
|
|
|
+ {
|
|
|
+ return view();
|
|
|
+ }
|
|
|
+
|
|
|
+ public function listSeeme()
|
|
|
+ {
|
|
|
+ $human = $this->_listValidate();
|
|
|
+ $where = [
|
|
|
+ ['type', '=', $human['type']],
|
|
|
+ ['human_id', '=', $human['data']['id']],
|
|
|
+ ];
|
|
|
+
|
|
|
+ $list = HumanSeeModel::where($where)
|
|
|
+ ->order(['update_time' => 'desc'])
|
|
|
+ ->limit(input('limit', 10))
|
|
|
+ ->page(input('page', 1))
|
|
|
+ ->select();
|
|
|
+
|
|
|
+ ajax_success($list);
|
|
|
+ }
|
|
|
+
|
|
|
private function _formValidate()
|
|
|
{
|
|
|
$open_id = session('mobile.human.open_id');
|
|
@@ -369,6 +418,7 @@ class Human extends MobileBaseController
|
|
|
if ($enterprise['status'] != HumanEnterpriseApplyModel::STATUS_PASS) {
|
|
|
throw new \think\exception\HttpResponseException(redirect(url('human/tips')));
|
|
|
}
|
|
|
+ return ['type' => '企业', 'data' => $enterprise];
|
|
|
}
|
|
|
|
|
|
}
|