123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- <?php
- namespace app\model\store\finance;
- use crmeb\basic\BaseModel;
- use crmeb\traits\ModelTrait;
- use app\model\store\SystemStore;
- use think\Model;
- class StoreExtract extends BaseModel
- {
- use ModelTrait;
-
- protected $pk = 'id';
-
- protected $name = 'store_extract';
-
- protected static $status = [
- -1 => '未通过',
- 0 => '审核中',
- 1 => '已提现'
- ];
-
- public function store()
- {
- return $this->hasOne(SystemStore::class, 'id', 'store_id')->hidden(['bank_code,bank_address', 'alipay_account', 'alipay_qrcode_url', 'wechat', 'wechat_qrcode_url']);
- }
-
- public function searchStoreIdAttr($query, $value)
- {
- if ($value !== '') {
- $query->where('store_id', $value);
- }
- }
-
- public function searchExtractTypeAttr($query, $value)
- {
- if ($value != '') $query->where('extract_type', $value);
- }
-
- public function searchStatusAttr($query, $value)
- {
- if ($value !== '') {
- $query->where('status', $value);
- }
- }
-
- public function searchPayStatusAttr($query, $value)
- {
- if ($value !== '') {
- $query->where('pay_status', $value);
- }
- }
-
- public function searchNotStatusAttr($query, $value)
- {
- if ($value !== '') {
- $query->where('status', '<>', $value);
- }
- }
- }
|