1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?php
- // +----------------------------------------------------------------------
- // | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
- // +----------------------------------------------------------------------
- // | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
- // +----------------------------------------------------------------------
- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
- // +----------------------------------------------------------------------
- // | Author: 老猫 <thinkcmf@126.com>
- // +----------------------------------------------------------------------
- namespace app\portal\controller;
- use app\portal\model\EnterpriseApplyJoinPlatformModel;
- use app\portal\model\WcCompayApplyModel;
- use cmf\controller\HomeBaseController;
- use app\user\model\UserModel;
- class CompanyinfoController extends HomeBaseController {
- public function index() {
- $user = cmf_get_current_user();
- $this->assign($user);
- $userId = cmf_get_current_user_id();
- $userModel = new UserModel();
- $user = $userModel->where('id', $userId)->find();
- $this->assign('user', $user);
- $m_wcca = new WcCompayApplyModel();
- $wccainfo = $m_wcca->find(['userid' => $userId]);
- if ($wccainfo) {
- $m_ea = new EnterpriseApplyJoinPlatformModel();
- $edinfo = $m_ea->find(['id' => $wccainfo['wc_compay_apply_id']]);
- $edinfo = $edinfo->toArray();
- } else {
- $edinfo = [
- 'companyname' => '',
- 'contactname' => '',
- 'telno' => '',
- 'licensephoto' => '',
- ];
- }
- $this->assign($edinfo);
- return $this->fetch(':company/index');
- }
- /**
- * 增加企业申请信息
- *
- * @return void
- * @author wj
- * @date 2025-09-08
- */
- public function addenterpriseapplyjoinplatform() {
- if ($this->request->isPost()) {
- $postData = $this->request->post();
- $userid = $postData['userid'];
- $m_wcca = new WcCompayApplyModel();
- $wccainfo = $m_wcca->find(['userid' => $userid]);
- $m_ea = new EnterpriseApplyJoinPlatformModel();
- if ($wccainfo) {
- //修改
- $postData['id'] = $wccainfo['wc_compay_apply_id'];
- $m_ea->updateinfo($postData);
- } else {
- //新增
- unset($postData['userid']);
- $id = $m_ea->addinfo($postData);
- $data = [
- 'wc_compay_apply_id' => $id,
- 'userid' => $userid,
- ];
- $id = $m_wcca->insertGetId($data);
- }
- $this->success('保存成功!');
- }
- }
- }
|