update:商户合同详情
This commit is contained in:
parent
fe31a235a7
commit
17789bf706
@ -2,7 +2,60 @@
|
|||||||
|
|
||||||
namespace app\common\model;
|
namespace app\common\model;
|
||||||
|
|
||||||
|
use app\common\model\contract\Contract;
|
||||||
|
use app\common\model\dict\DictData;
|
||||||
|
use think\facade\Db;
|
||||||
|
|
||||||
class ShopMerchant extends BaseModel
|
class ShopMerchant extends BaseModel
|
||||||
{
|
{
|
||||||
protected $name = 'shop_merchant';
|
protected $name = 'shop_merchant';
|
||||||
|
|
||||||
|
public function getCompanyTypeNameAttr($value)
|
||||||
|
{
|
||||||
|
return DictData::where('id', $value)->value('name');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getProvinceNameAttr($value)
|
||||||
|
{
|
||||||
|
return Db::name('geo_province')->where(['province_code' => $this->province])->value('province_name');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCityNameAttr($value)
|
||||||
|
{
|
||||||
|
return Db::name('geo_city')->where(['city_code' => $this->city])->value('city_name');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAreaNameAttr($value)
|
||||||
|
{
|
||||||
|
return Db::name('geo_area')->where(['area_code' => $this->area])->value('area_name');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getStreetNameAttr($value)
|
||||||
|
{
|
||||||
|
return Db::name('geo_street')->where(['street_code' => $this->street])->value('street_name');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getVillageNameAttr($value)
|
||||||
|
{
|
||||||
|
return Db::name('geo_village')->where(['village_code' => $this->village])->value('village_name');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBrigadeNameAttr($value)
|
||||||
|
{
|
||||||
|
return Db::name('geo_brigade')->where(['id' => $this->brigade])->value('brigade_name');
|
||||||
|
}
|
||||||
|
public function getAreaManagerNameAttr($value)
|
||||||
|
{
|
||||||
|
return Db::name('admin')->where(['id' => $this->area_manager])->value('name');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getContractAttr()
|
||||||
|
{
|
||||||
|
$find=Contract::where('party_a|party_b', $this->id)->field('check_status,status')->find();
|
||||||
|
if($find){
|
||||||
|
return $find->toArray();
|
||||||
|
}else{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user