90 lines
2.4 KiB
PHP
90 lines
2.4 KiB
PHP
![]() |
<?php
|
|||
|
// +----------------------------------------------------------------------
|
|||
|
// | 作者:修缘 联系QQ:278896498 QQ群:1054861244
|
|||
|
// | 声明:未经作者许可,禁止倒卖等商业运营,违者必究
|
|||
|
// | 另接php业务,网站制作、代理后台、gm后台、支付对接等
|
|||
|
// +----------------------------------------------------------------------
|
|||
|
// | 创建时间: 2022/1/9 16:59
|
|||
|
// +----------------------------------------------------------------------
|
|||
|
|
|||
|
|
|||
|
namespace app\common\model;
|
|||
|
|
|||
|
|
|||
|
use app\admin\model\AgencyUser;
|
|||
|
|
|||
|
class CheckOut extends Model
|
|||
|
{
|
|||
|
// 自定义选择数据
|
|||
|
|
|||
|
public $softDelete = false;
|
|||
|
protected $autoWriteTimestamp = true;
|
|||
|
|
|||
|
protected $updateTime = 'update_time';
|
|||
|
|
|||
|
|
|||
|
//可搜索字段
|
|||
|
protected $searchField = ['name', 'bank_account'];
|
|||
|
|
|||
|
//可作为条件的字段
|
|||
|
protected $whereField = ['type', 'agency', 'status'];
|
|||
|
protected $specialTimeFiled = 'create_time';
|
|||
|
|
|||
|
//可做为时间
|
|||
|
protected $timeField = ['create_time', 'update_time'];
|
|||
|
static $bank_type_text;
|
|||
|
|
|||
|
protected static function init()
|
|||
|
{
|
|||
|
parent::init(); // TODO: Change the autogenerated stub
|
|||
|
self::$bank_type_text = [
|
|||
|
0 => lang('alipay_name'),
|
|||
|
1 => lang('alipay_name'),
|
|||
|
2 => lang('WeChat_name'),
|
|||
|
3 => lang('qq_name'),
|
|||
|
4 => lang('boc_name'),
|
|||
|
5 => lang('icbc_name'),
|
|||
|
6 => lang('ccb_name'),
|
|||
|
7 => lang('abchina_name'),
|
|||
|
8 => lang('cmbchina_name'),
|
|||
|
9 => lang('psbc_name'),
|
|||
|
10 => lang('bankcomm_name'),
|
|||
|
11 => lang('cash_name'),
|
|||
|
12 => lang('else_name'),
|
|||
|
];
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
public function scopeSon($query, $son_agency)
|
|||
|
{
|
|||
|
$query->whereIn('agency', $son_agency);
|
|||
|
}
|
|||
|
|
|||
|
public function scopeDirectlySon($query, $directlySon)
|
|||
|
{
|
|||
|
$query->whereIn('agency', $directlySon);
|
|||
|
}
|
|||
|
|
|||
|
public function scopeAgencyDirectlySon($query)
|
|||
|
{
|
|||
|
$query->where(['parent_id' => 0, 'grandpa_id' => 0]);
|
|||
|
}
|
|||
|
|
|||
|
public function agency()
|
|||
|
{
|
|||
|
return $this->belongsTo(AgencyUser::class,'agency_id', 'id');
|
|||
|
}
|
|||
|
//获取器
|
|||
|
public function getStatusTextAttr($value, $data)
|
|||
|
{
|
|||
|
return self::BOOLEAN_TEXT[$data['status']];
|
|||
|
}
|
|||
|
|
|||
|
public function getTypeTextAttr($value, $data)
|
|||
|
{
|
|||
|
return self::$bank_type_text[$data['type']];
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
}
|