coupon-admin/app/model/Business.php

44 lines
1.0 KiB
PHP
Raw Normal View History

2021-11-18 09:57:04 +00:00
<?php
namespace app\model;
2021-11-30 10:52:02 +00:00
use think\model\relation\HasOne;
2021-11-18 09:57:04 +00:00
class Business extends Base
{
2022-02-08 08:38:36 +00:00
2021-12-16 02:34:06 +00:00
const state_reviewing = 0;//待审核
const state_on = 1;//审核通过
const state_off = 2;//驳回
2022-02-08 08:38:36 +00:00
const state_consumer = 4;//未认证
2021-11-30 10:31:58 +00:00
2021-12-16 02:34:06 +00:00
const model_ordinary = 0;//普通商家
2022-03-30 07:52:49 +00:00
const model_time_limit = 1;//时限商家
2021-11-30 10:52:02 +00:00
/**
* @remarks 代理商、平台商、平台代理商、渠道商等词组均描述的是代理商,因此文案统一为【代理商】
2021-11-30 10:52:02 +00:00
*/
2021-12-16 02:34:06 +00:00
static function allModel()
{
return [
self::model_ordinary=>"普通商家",
2022-03-30 07:52:49 +00:00
self::model_time_limit=>"时限商家",
2021-12-16 02:34:06 +00:00
];
}
2021-11-24 06:41:24 +00:00
public function category()
{
return $this->hasOne(Category::class, 'id',"type");
}
2021-11-30 10:52:02 +00:00
2021-11-30 10:31:58 +00:00
public function account()
{
return $this->hasOne(Account::class, 'business_code',"code");
}
2021-12-01 08:53:44 +00:00
public function agency()
{
return $this->hasOne(self::class,"code","agency_code");
}
2021-12-02 02:41:02 +00:00
2021-11-18 09:57:04 +00:00
}