AgentAttrsDayModel.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * 描述.
  4. *
  5. * @author nj
  6. * @date 2021-05-18 20:46:19
  7. */
  8. namespace App\Models\Mysql;
  9. class AgentAttrsDayModel extends BaseMysql
  10. {
  11. protected $table = 'agent_attrs_day';
  12. /**
  13. * UUID 键名
  14. * @var string
  15. */
  16. protected $uuidKeyName = 'agent_uid';
  17. public function getCommonSubffixFields()
  18. {
  19. $fields = array_merge(self::getCommonOrderSubffixFields(), self::getCommonUsersSubffixFields());
  20. return $fields;
  21. }
  22. public function getCommonOrderSubffixFields()
  23. {
  24. $fileds = [
  25. 'order_total', 'order_success', 'order_failed', 'order_money', 'order_success_money',
  26. 'android_total', 'android_success', 'android_failed', 'android_money', 'android_success_money',
  27. 'ios_total', 'ios_success', 'ios_failed', 'ios_money', 'ios_success_money',
  28. 'h5_total', 'h5_success', 'h5_failed', 'h5_money', 'h5_success_money',
  29. 'deduction_total', 'deduction_success', 'deduction_failed', 'deduction_money', 'deduction_success_money',
  30. 'commission_money'
  31. ];
  32. return $fileds;
  33. }
  34. public function getCommonUsersSubffixFields()
  35. {
  36. $fields = [
  37. 'users_total', 'users_android_total', 'users_ios_total', 'users_h5_total',
  38. 'users_deduction', 'users_android_deduction', 'users_ios_deduction', 'users_h5_deduction',
  39. ];
  40. return $fields;
  41. }
  42. /**
  43. * 单个代理关系
  44. * @return \Illuminate\Database\Eloquent\Relations\HasOne
  45. */
  46. public function agent()
  47. {
  48. return $this->hasOne(AgentModel::class, 'uid', 'agent_uid');
  49. }
  50. }