| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.com
- * Copyright (c) 2023 爆块云 All rights reserved.
- */
- /*
- * @Author: your name
- * @Date: 2021-03-02 09:50:20
- * @LastEditTime: 2021-04-29 15:29:26
- * @LastEditors: Please set LastEditors
- * @Description: In User Settings Edit
- * @FilePath: \admin_php\models\OrderDetail.php
- */
- namespace app\models;
- use Yii;
- /**
- * This is the model class for table "{{%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 string $integral
- * @property integer $is_level
- * @property string $goods_name
- * @property string $goods_info
- * @property string $delivery_type
- * @property string $shop_id
- * @property integer $profit
- */
- class OrderPospalDetail extends \yii\db\ActiveRecord
- {
- /**
- * 类型枚举
- * 快递
- */
- const GOODS_DELIVERY_EXPRESS = 0;
- /**
- * 类型枚举
- * 自提
- */
- const GOODS_DELIVERY_SHOP = 1;
- /**
- * 类型枚举
- * 同城
- */
- const GOODS_DELIVERY_IM = 2;
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return '{{%order_pospal_detail}}';
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['order_id', 'goods_id', 'attr', 'pic'], 'required'],
- [['order_id', 'goods_id', 'num', 'created_at', 'is_delete', 'integral', 'is_level', 'delivery_type', 'shop_id','order_transit_id','integral_price'], 'integer'],
- [['total_price', 'supplier_price', 'profit','integral_difference_price'], 'number'],
- [['attr', 'goods_info'], 'string'],
- [['pic','batch_price_tips', 'goods_name'], 'string', 'max' => 255],
- ];
- }
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'order_id' => 'Order ID',
- 'goods_id' => 'Goods ID',
- 'num' => '商品数量',
- 'total_price' => '此商品的总价',
- 'integral_price' => '销售积分',
- 'integral_difference_price' => '积分差额',
- 'created_at' => 'Addtime',
- 'is_delete' => 'Is Delete',
- 'attr' => '商品规格',
- 'pic' => '商品规格图片',
- 'integral' => '获取积分',
- 'is_level' => '会员折扣',
- 'batch_price_tips' => '满减价格提示',
- 'supplier_price' => '供货商进价',
- 'goods_name' => '商品名称',
- 'goods_info' => '商品快照',
- 'delivery_type' => '配送方式,0:快递,1:自提',
- 'shop_id' => '自提点id,默认:0',
- 'order_transit_id' => '云仓转单id'
- ];
- }
- public function getGoods()
- {
- return $this->hasOne(Goods::className(), ['id'=>'goods_id']);
- }
- public function getOrder() {
- return $this->hasOne(OrderPospal::className(), ['id' => 'order_id']);
- }
- }
|