|
@@ -6,6 +6,7 @@ use app\common\model\HumanEnterpriseApplyModel;
|
|
|
use app\common\model\HumanEnterpriseModel;
|
|
|
use app\common\model\HumanInstitutionApplyModel;
|
|
|
use app\common\model\HumanInstitutionModel;
|
|
|
+use app\common\model\HumanSeeModel;
|
|
|
use app\common\validate\HumanEnterpriseApplyValidate;
|
|
|
use app\common\validate\HumanInstitutionApplyValidate;
|
|
|
use app\mobile\MobileBaseController;
|
|
@@ -186,18 +187,25 @@ class Human extends MobileBaseController
|
|
|
{
|
|
|
$this->_listValidate();
|
|
|
|
|
|
- $cooperate_list = [['text' => '全部', 'value' => '']];
|
|
|
+ $cooperate_list = [['text' => '全部业务', 'value' => '']];
|
|
|
foreach (HumanInstitutionModel::COOPERATE as $cooperate) {
|
|
|
$cooperate_list[] = ['text' => $cooperate, 'value' => $cooperate];
|
|
|
}
|
|
|
+
|
|
|
+ $industry_list = [['text' => '全部行业', 'value' => '']];
|
|
|
+ foreach (HumanEnterpriseModel::INDUSTRY as $industry) {
|
|
|
+ $industry_list[] = ['text' => $industry, 'value' => $industry];
|
|
|
+ }
|
|
|
+
|
|
|
return view('', [
|
|
|
'cooperate_list' => json_encode($cooperate_list),
|
|
|
+ 'industry_list' => json_encode($industry_list),
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
public function listEnterprise()
|
|
|
{
|
|
|
- $where = $this->dealLikeInput(['name', 'cooperate']);
|
|
|
+ $where = $this->dealLikeInput(['name', 'cooperate', 'industry']);
|
|
|
$where[] = ['status', '=', HumanEnterpriseModel::STATUS_SHOW];
|
|
|
|
|
|
$list = HumanEnterpriseModel::where($where)
|
|
@@ -211,7 +219,7 @@ class Human extends MobileBaseController
|
|
|
|
|
|
public function enterpriseDetail()
|
|
|
{
|
|
|
- $this->_listValidate();
|
|
|
+ $human = $this->_listValidate();
|
|
|
|
|
|
$id = input('id');
|
|
|
empty($id) && jump('该企业不存在或已删除');
|
|
@@ -219,6 +227,16 @@ 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'],
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+
|
|
|
return view('', ['info' => $info]);
|
|
|
}
|
|
|
|
|
@@ -280,14 +298,14 @@ class Human extends MobileBaseController
|
|
|
|
|
|
public function bindMobile()
|
|
|
{
|
|
|
- $mobile = input('mobile','');
|
|
|
- empty($mobile) && ajax_return(1,'请输入手机号');
|
|
|
+ $mobile = input('mobile', '');
|
|
|
+ empty($mobile) && ajax_return(1, '请输入手机号');
|
|
|
|
|
|
$institution = HumanInstitutionApplyModel::where('join_mobile', $mobile)->find();
|
|
|
if (empty($institution)) {
|
|
|
- $enterprise = HumanEnterpriseApplyModel::where('join_mobile', $mobile)->find();
|
|
|
+ $enterprise = HumanEnterpriseApplyModel::where('join_mobile', $mobile)->find();
|
|
|
if (empty($enterprise)) {
|
|
|
- ajax_return(1,'该手机号未报名,请确认手机号');
|
|
|
+ ajax_return(1, '该手机号未报名,请确认手机号');
|
|
|
} else {
|
|
|
$enterprise->open_id = session('mobile.human.open_id');
|
|
|
$enterprise->save();
|
|
@@ -326,12 +344,12 @@ class Human extends MobileBaseController
|
|
|
|
|
|
private function _listValidate()
|
|
|
{
|
|
|
- $action = $this->request->action();
|
|
|
+ /*$action = $this->request->action();
|
|
|
if ($action != 'center') {
|
|
|
if (time() < 1730736000) {
|
|
|
jump('11月5日开启,敬请期待','mobile/human/center');
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
$open_id = session('mobile.human.open_id');
|
|
|
|
|
|
$institution = HumanInstitutionApplyModel::where('open_id', $open_id)->find();
|
|
@@ -344,6 +362,7 @@ class Human extends MobileBaseController
|
|
|
if ($institution['status'] != HumanInstitutionApplyModel::STATUS_PASS) {
|
|
|
throw new \think\exception\HttpResponseException(redirect(url('human/tips')));
|
|
|
}
|
|
|
+ return ['type' => '机构', 'data' => $institution];
|
|
|
}
|
|
|
|
|
|
if (!empty($enterprise)) {
|