Commit e65fe2f9 by 朱继来

Merge branch 'zjl_new_order_20210926' into development

parents 9f603b53 f33397ac
Showing with 28 additions and 27 deletions
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
class RegionModel extends Model
{
protected $connection = 'order';
protected $table = 'lie_region';
protected $primaryKey = 'region_id';
public $timestamps = false;
// 获取指定类型地址
public function getRegion($region_type=1)
{
$map['region_type'] = $region_type;
return $this->where($map)->select('region_id', 'parent_id', 'region_name')->get()->toArray();
}
// 获取地址名称
public function getRegionName($region_id)
{
if (!$region_id) return null;
return $this->where('region_id', $region_id)->value('region_name');
}
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
class RegionModel extends Model
{
protected $connection = 'web';
protected $table = 'lie_region';
protected $primaryKey = 'region_id';
public $timestamps = false;
// 获取指定类型地址
public function getRegion($region_type=1)
{
$map['region_type'] = $region_type;
return $this->where($map)->select('region_id', 'parent_id', 'region_name')->get()->toArray();
}
// 获取地址名称
public function getRegionName($region_id)
{
if (!$region_id) return null;
return $this->where('region_id', $region_id)->value('region_name');
}
}
\ 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