123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?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\model;
- use app\admin\model\RouteModel;
- use think\Model;
- use tree\Tree;
- use think\db\Query;
- class EnterpriseApplyJoinPlatformModel extends Model {
- /**
- * 模型名称
- * @var string
- */
- protected $name = 't_enterprise_apply_join_platform';
- protected $connection = 'watercat';
- protected $type = [
- 'more' => 'array',
- ];
- public function addinfo($data) {
- $id = $this->insertGetId($data);
- return $id;
- }
- public function updateinfo($data) {
- $id = $data['id'];
- unset($data['id']);
- $info = $this->find(['id' => $id]);
- $fields = ['contactname', 'companyname', 'licensephoto'];
- $updateData = [];
- foreach ($fields as $key => $value) {
- if (!empty($data[$value]) && $data[$value] != $info[$info]) {
- $updateData[$value] = $data[$value];
- }
- }
- if (!empty($updateData)) {
- $where = ['id', $data['id']];
- $this->update($updateData, $where);
- }
- }
- }
|