AccountLogModel.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | LARAVEL8.0 框架 [ LARAVEL ][ RXThinkCMF ]
  4. // +----------------------------------------------------------------------
  5. // | 版权所有 2017~2021 LARAVEL研发中心
  6. // +----------------------------------------------------------------------
  7. // | 官方网站: http://www.laravel.cn
  8. // +----------------------------------------------------------------------
  9. // | Author: laravel开发员 <laravel.qq.com>
  10. // +----------------------------------------------------------------------
  11. namespace App\Models;
  12. use App\Services\RedisService;
  13. use Illuminate\Support\Facades\DB;
  14. /**
  15. * 账户明细-模型
  16. * @author laravel开发员
  17. * @since 2020/11/10
  18. * Class ActionLogModel
  19. * @package App\Models
  20. */
  21. class AccountLogModel extends BaseModel
  22. {
  23. // 设置数据表
  24. protected $table = 'account_log';
  25. /**
  26. * 用户
  27. * @return \Illuminate\Database\Eloquent\Relations\HasOne
  28. */
  29. public function member()
  30. {
  31. return $this->hasOne(MemberModel::class, 'id','user_id')
  32. ->where(['mark'=>1])
  33. ->select(['id','nickname','username','realname','balance','trc_url','usdt','avatar','status']);
  34. }
  35. /**
  36. * 承兑商
  37. * @return \Illuminate\Database\Eloquent\Relations\HasOne
  38. */
  39. public function acceptor()
  40. {
  41. return $this->hasOne(AcceptorModel::class, 'id','user_id')
  42. ->where(['mark'=>1])
  43. ->select(['id','name as nickname','user_id','mobile']);
  44. }
  45. /**
  46. * 商家
  47. * @return \Illuminate\Database\Eloquent\Relations\HasOne
  48. */
  49. public function merchant()
  50. {
  51. return $this->hasOne(MerchantModel::class, 'id','user_id')
  52. ->where(['mark'=>1])
  53. ->select(['id','name as nickname','user_id','mobile']);
  54. }
  55. }