Commit 8de4f3be by 朱继来

Merge branch 'zjl_order_20200923'

parents c1317f7b 91390ae0
Showing with 37 additions and 34 deletions
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
use Request;
use Excel;
use DB;
use App\Model\RegionModel;
class UserCompanyModel extends Model
{
protected $connection = 'order';
protected $table = 'lie_user_company';
protected $primaryKey = 'com_id';
public $timestamps = false;
// 获取公司信息
public function getCompanyInfo($user_id)
{
$info = $this->where('user_id', $user_id)->first();
// 公司性质
$company_type = Config('params.company_type');
$info['type_id_val'] = $company_type[$info['type_id']];
// 省市区
$RegionModel = new RegionModel;
$info['com_province'] = $RegionModel->getRegionName($info['com_province_id']);
$info['com_city'] = $RegionModel->getRegionName($info['com_city_id']);
$info['com_area'] = $RegionModel->getRegionName($info['com_area_id']);
return $info;
}
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
use Request;
use Excel;
use DB;
use App\Model\RegionModel;
class UserCompanyModel extends Model
{
protected $connection = 'order';
protected $table = 'lie_user_company';
protected $primaryKey = 'com_id';
public $timestamps = false;
// 获取公司信息
public function getCompanyInfo($user_id)
{
$info = $this->where('user_id', $user_id)->first();
if (!$info) return false;
// 公司性质
$company_type = Config('params.company_type');
$info['type_id_val'] = $company_type[$info['type_id']];
// 省市区
$RegionModel = new RegionModel;
$info['com_province'] = $RegionModel->getRegionName($info['com_province_id']);
$info['com_city'] = $RegionModel->getRegionName($info['com_city_id']);
$info['com_area'] = $RegionModel->getRegionName($info['com_area_id']);
return $info;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment