| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?php
- namespace addons\Achievement\common\models;
- use common\models\base\BaseActiveRecord;
- use common\models\goods\Goods;
- use common\models\user\User;
- use Yii;
- /**
- * This is the model class for table "qimall_addons_achievement_order_log".
- *
- * @property int $id
- * @property int $mall_id
- * @property int $user_id
- * @property int $grant_id 规则id
- * @property int $goods_id 商品id
- * @property string $order_no 订单编号
- * @property int $order_detail_id 订单详情id
- * @property int $chief_user_id 队长的用户id
- * @property float $price 订单金额(支付金额)
- * @property int|null $is_cloud 是否云库存商品
- * @property int|null $order_create_time 订单创建时间
- * @property int $created_at
- * @property int $updated_at
- * @property int $status 状态[-1:删除;0:禁用;1启用]
- */
- class AchievementOrderLog extends BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return 'qimall_addons_achievement_order_log';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['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'],
- [['order_no'], 'required'],
- [['price','equal_first','equal_second'], 'number'],
- [['order_no'], 'string', 'max' => 255],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'mall_id' => 'Mall ID',
- 'user_id' => 'User ID',
- 'grant_id' => '规则id',
- 'goods_id' => '商品id',
- 'order_no' => '订单编号',
- 'order_detail_id' => '订单详情id',
- 'chief_user_id' => '队长的用户id',
- 'price' => '订单金额(支付金额)',
- 'is_cloud' => '是否云库存商品',
- 'order_create_time' => '订单创建时间',
- 'created_at' => 'Created At',
- 'updated_at' => 'Updated At',
- 'status' => '状态[-1:删除;0:禁用;1启用]',
- ];
- }
- // 关联模型
- public function getUser()
- {
- return $this->hasOne(User::class, ['id' => 'user_id']);
- }
- // 关联模型
- public function getGoods()
- {
- return $this->hasOne(Goods::class, ['id' => 'goods_id']);
- }
- }
|