BankCash.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2017 https://www.sapixx.com All rights reserved.
  4. * @license Licensed (http://www.apache.org/licenses/LICENSE-2.0).
  5. * @author pillar<ltmn@qq.com>
  6. * 用户银行表 Table<ai_fastshop_bank_cash>
  7. */
  8. namespace app\fastshop\model;
  9. use think\Model;
  10. use think\facade\Validate;
  11. class BankCash extends Model{
  12. protected $pk = 'id';
  13. protected $table = 'ai_fastshop_bank_cash';
  14. protected $re_table = 'fastshop_bank_recharge';
  15. protected $autoWriteTimestamp = true;
  16. protected $createTime = false;
  17. /**
  18. * 充值表
  19. */
  20. public function re_table(){
  21. return self::table('ai_'.$this->re_table);
  22. }
  23. /**
  24. * 提醒信息
  25. */
  26. public function info(){
  27. return $this->hasOne('BankInfo','user_id','user_id');
  28. }
  29. /**
  30. * 申请提现列表
  31. */
  32. public function lists($miniapp_id,$condition){
  33. return self::view('fastshop_bank_cash','*')
  34. ->view('system_user','nickname,phone_uid','fastshop_bank_cash.user_id = system_user.id')
  35. ->where(['fastshop_bank_cash.member_miniapp_id' => $miniapp_id])
  36. ->where($condition)
  37. ->order('id desc');
  38. }
  39. /**
  40. * 查看申请
  41. */
  42. public function finds($where){
  43. return self::view('fastshop_bank_cash','*')
  44. ->view('system_user','nickname,face','fastshop_bank_cash.user_id = system_user.id')
  45. ->where($where)->find();
  46. }
  47. }