| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?php
- namespace addons\ValetOrder\common\models;
- use common\models\order\Order;
- use common\models\user\User;
- use Yii;
- /**
- * This is the model class for table "qimall_addons_valet_order".
- *
- * @property int $id ID
- * @property int $mall_id 商城ID
- * @property int $status 状态[1启用 0禁用 -1删除]
- * @property int $created_at 创建时间
- * @property int $updated_at 更新事件
- * @property int $user_id 用户ID
- * @property int $buy_user_id 买家ID
- * @property int $order_id 订单ID
- * @property string $order_no 订单编号
- * @property string $mobile 订单编号
- * @property string $parent_mobile 订单编号
- * @property int $order_status 订单状态
- * @property int $order_amount 订单状态
- * @property string|null $order_goods_names 订单商品名称
- */
- class ValetOrder extends \common\models\base\BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return 'qimall_addons_valet_order';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id', 'status', 'created_at', 'updated_at', 'user_id', 'buy_user_id', 'order_id', 'order_status', 'order_amount'], 'integer'],
- [['order_goods_names'], 'string'],
- [['mobile', 'parent_mobile'], 'string', 'max' => 15],
- [['order_no'], 'string', 'max' => 30],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'mall_id' => 'Mall ID',
- 'status' => 'Status',
- 'created_at' => 'Created At',
- 'updated_at' => 'Updated At',
- 'user_id' => 'User ID',
- 'buy_user_id' => 'Buy User ID',
- 'order_id' => 'Order ID',
- 'order_no' => 'Order No',
- 'order_status' => 'Order Status',
- 'order_goods_names' => 'Order Goods Names',
- ];
- }
- public function getUser()
- {
- return $this->hasOne(User::class, ['id' => 'user_id'])->select('id, username, nickname, avatar_url, mobile');
- }
- public function getBuyUser()
- {
- return $this->hasOne(User::class, ['id' => 'buy_user_id'])->select('id, username, nickname, avatar_url, mobile');
- }
- public function getOrder()
- {
- return $this->hasOne(Order::class, ['id' => 'order_id']);
- }
- }
|