| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?php
- namespace addons\QiDingDong\common\models;
- use Yii;
- /**
- * This is the model class for table "qimall_addons_qi_ding_dong_goods".
- *
- * @property int $id ID
- * @property int $mall_id 商城ID
- * @property int $created_at 创建时间
- * @property int $updated_at 更新时间
- * @property int $status 状态
- * @property int $goods_id 本地商品ID
- * @property int $third_goods_id 第三方商品ID
- * @property array|null $content 数据
- * @property array|null $ship_method 数据
- * @property string $goods_name 商品名称
- * @property int $cate_one 一级类目
- * @property int $cate_two 二级类目
- * @property int $cate_three 三级类目
- * @property int $import_at 三级类目
- * @property int $goods_type 三级类目
- * @property int $discount 三级类目
- * @property int $can_sale 三级类目
- * @property string $default_image 三级类目
- * @property float $retail_price 三级类目
- * @property float $price 三级类目
- * @property float $lowest_price 三级类目
- */
- class QiDingDongGoods extends \common\models\base\BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return 'qimall_addons_qi_ding_dong_goods';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id', 'created_at', 'updated_at', 'status', 'goods_id', 'third_goods_id',
- 'cate_one', 'cate_two', 'cate_three', 'import_at', 'goods_type', 'discount', 'can_sale'], 'integer'],
- [['content', 'ship_method'], 'safe'],
- [['retail_price', 'price', 'lowest_price'], 'number'],
- [['goods_name'], 'string', 'max' => 255],
- [['default_image'], 'string', 'max' => 500],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'mall_id' => 'Mall ID',
- 'created_at' => 'Created At',
- 'updated_at' => 'Updated At',
- 'status' => 'Status',
- 'goods_id' => 'Goods ID',
- 'third_goods_id' => 'Third Goods ID',
- 'content' => 'Content',
- 'goods_name' => 'Goods Name',
- 'cate_one' => 'Cate One',
- 'cate_two' => 'Cate Two',
- 'cate_three' => 'Cate Three',
- ];
- }
- public function getCateOne()
- {
- return $this->hasOne(QiDingDongCate::class, ['third_cate_id' => 'cate_one']);
- }
- public function getCateTwo()
- {
- return $this->hasOne(QiDingDongCate::class, ['third_cate_id' => 'cate_two']);
- }
- }
|