1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace app\fastshop\model;
- use think\Model;
- use think\facade\Validate;
- class BankCash extends Model{
-
- protected $pk = 'id';
- protected $table = 'ai_fastshop_bank_cash';
- protected $re_table = 'fastshop_bank_recharge';
- protected $autoWriteTimestamp = true;
- protected $createTime = false;
-
- public function re_table(){
- return self::table('ai_'.$this->re_table);
- }
-
- public function info(){
- return $this->hasOne('BankInfo','user_id','user_id');
- }
-
- public function lists($miniapp_id,$condition){
- return self::view('fastshop_bank_cash','*')
- ->view('system_user','nickname,phone_uid','fastshop_bank_cash.user_id = system_user.id')
- ->where(['fastshop_bank_cash.member_miniapp_id' => $miniapp_id])
- ->where($condition)
- ->order('id desc');
- }
-
- public function finds($where){
- return self::view('fastshop_bank_cash','*')
- ->view('system_user','nickname,face','fastshop_bank_cash.user_id = system_user.id')
- ->where($where)->find();
- }
- }
|