| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- namespace app\plugins\food\models;
- use Yii;
- /**
- * This is the model class for table "{{%food_order_detail}}".
- *
- * @property integer $id
- * @property integer $order_id
- * @property integer $goods_id
- * @property integer $num
- * @property string $total_price
- * @property integer $created_at
- * @property integer $is_delete
- * @property string $attr
- * @property string $pic
- * @property integer $is_level
- * @property string $goods_name
- * @property string $goods_info
- * @property integer $times
- */
- class FoodOrderDetail extends \yii\db\ActiveRecord
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return '{{%food_order_detail}}';
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['order_id', 'goods_id', 'attr', 'pic'], 'required'],
- [['order_id', 'goods_id', 'num', 'created_at', 'is_delete', 'is_level', 'times'], 'integer'],
- [['total_price'], 'number'],
- [['attr'], 'string'],
- [['pic', 'goods_name'], 'string', 'max' => 255],
- ];
- }
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'order_id' => 'Order ID',
- 'goods_id' => 'Goods ID',
- 'num' => '商品数量',
- 'total_price' => '此商品的总价',
- 'created_at' => 'Addtime',
- 'is_delete' => 'Is Delete',
- 'attr' => '商品规格',
- 'pic' => '商品规格图片',
- 'is_level' => '会员折扣',
- 'goods_name' => '商品名称',
- ];
- }
- public function getGoods()
- {
- return $this->hasOne(FoodGoods::className(), ['id'=>'goods_id']);
- }
- public function getOrder() {
- return $this->hasOne(FoodOrder::className(), ['id' => 'order_id']);
- }
- }
|