AchievementOrderLog.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. namespace addons\Achievement\common\models;
  3. use common\models\base\BaseActiveRecord;
  4. use common\models\goods\Goods;
  5. use common\models\user\User;
  6. use Yii;
  7. /**
  8. * This is the model class for table "qimall_addons_achievement_order_log".
  9. *
  10. * @property int $id
  11. * @property int $mall_id
  12. * @property int $user_id
  13. * @property int $grant_id 规则id
  14. * @property int $goods_id 商品id
  15. * @property string $order_no 订单编号
  16. * @property int $order_detail_id 订单详情id
  17. * @property int $chief_user_id 队长的用户id
  18. * @property float $price 订单金额(支付金额)
  19. * @property int|null $is_cloud 是否云库存商品
  20. * @property int|null $order_create_time 订单创建时间
  21. * @property int $created_at
  22. * @property int $updated_at
  23. * @property int $status 状态[-1:删除;0:禁用;1启用]
  24. */
  25. class AchievementOrderLog extends BaseActiveRecord
  26. {
  27. /**
  28. * {@inheritdoc}
  29. */
  30. public static function tableName()
  31. {
  32. return 'qimall_addons_achievement_order_log';
  33. }
  34. /**
  35. * {@inheritdoc}
  36. */
  37. public function rules()
  38. {
  39. return [
  40. [['mall_id', 'user_id', 'grant_id', 'goods_id', 'order_detail_id', 'chief_user_id', 'is_cloud', 'order_create_time', 'created_at', 'updated_at', 'status','is_alone_equal'], 'integer'],
  41. [['order_no'], 'required'],
  42. [['price','equal_first','equal_second'], 'number'],
  43. [['order_no'], 'string', 'max' => 255],
  44. ];
  45. }
  46. /**
  47. * {@inheritdoc}
  48. */
  49. public function attributeLabels()
  50. {
  51. return [
  52. 'id' => 'ID',
  53. 'mall_id' => 'Mall ID',
  54. 'user_id' => 'User ID',
  55. 'grant_id' => '规则id',
  56. 'goods_id' => '商品id',
  57. 'order_no' => '订单编号',
  58. 'order_detail_id' => '订单详情id',
  59. 'chief_user_id' => '队长的用户id',
  60. 'price' => '订单金额(支付金额)',
  61. 'is_cloud' => '是否云库存商品',
  62. 'order_create_time' => '订单创建时间',
  63. 'created_at' => 'Created At',
  64. 'updated_at' => 'Updated At',
  65. 'status' => '状态[-1:删除;0:禁用;1启用]',
  66. ];
  67. }
  68. // 关联模型
  69. public function getUser()
  70. {
  71. return $this->hasOne(User::class, ['id' => 'user_id']);
  72. }
  73. // 关联模型
  74. public function getGoods()
  75. {
  76. return $this->hasOne(Goods::class, ['id' => 'goods_id']);
  77. }
  78. }