DoubleCopySpread.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. namespace addons\DoubleCopy\common\models;
  3. use common\models\user\User;
  4. use yii\db\Exception;
  5. use Yii;
  6. /**
  7. * This is the model class for table "qimall_addons_double_copy_spread".
  8. *
  9. * @property int $id
  10. * @property int $mall_id
  11. * @property int $pull_user_id 选择下级用户
  12. * @property int $push_user_id 绑定上级用户
  13. * @property int $original_pid 原来的推荐人ID
  14. * @property int $admin_id 后台操作用户ID
  15. * @property int|null $created_at 创建时间
  16. */
  17. class DoubleCopySpread extends \common\models\base\BaseActiveRecord
  18. {
  19. /**
  20. * {@inheritdoc}
  21. */
  22. public static function tableName()
  23. {
  24. return 'qimall_addons_double_copy_spread';
  25. }
  26. /**
  27. * {@inheritdoc}
  28. */
  29. public function rules()
  30. {
  31. return [
  32. [['mall_id', 'pull_user_id', 'push_user_id', 'created_at','admin_id','updated_at'], 'integer'],
  33. ];
  34. }
  35. /**
  36. * {@inheritdoc}
  37. */
  38. public function attributeLabels()
  39. {
  40. return [
  41. 'id' => 'ID',
  42. 'mall_id' => 'Mall ID',
  43. 'pull_user_id' => 'Pull User ID',
  44. 'push_user_id' => 'Push User ID',
  45. 'spread_status' => 'Spread Status',
  46. 'created_at' => 'Created At',
  47. ];
  48. }
  49. /**
  50. * 关联用户表
  51. * @Author: lun
  52. * @DateTime: 2022/9/16 0016 16:50
  53. * @Copyright: copyright (c) 2021 广东七件事集团
  54. * @return \yii\db\ActiveQuery
  55. */
  56. public function getPullUser()
  57. {
  58. return $this->hasOne(User::class, ['id' => 'pull_user_id'])->select('id,mobile,nickname,avatar_url,parent_id');
  59. }
  60. /**
  61. * 关联用户表
  62. * @Author: lun
  63. * @DateTime: 2022/9/16 0016 16:50
  64. * @Copyright: copyright (c) 2021 广东七件事集团
  65. * @return \yii\db\ActiveQuery
  66. */
  67. public function getPushUser()
  68. {
  69. return $this->hasOne(User::class, ['id' => 'push_user_id'])->select('id,mobile,nickname,avatar_url,parent_id');
  70. }
  71. /**
  72. * 关联用户表
  73. * @Author: lun
  74. * @DateTime: 2022/9/16 0016 16:50
  75. * @Copyright: copyright (c) 2021 广东七件事集团
  76. * @return \yii\db\ActiveQuery
  77. */
  78. public function getOriginalUser()
  79. {
  80. return $this->hasOne(User::class, ['id' => 'original_pid'])->select('id,mobile,nickname,avatar_url,parent_id');
  81. }
  82. }