| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?php
- namespace addons\QiShangTong\common\models;
- use Yii;
- /**
- * This is the model class for table "qimall_addons_qi_shang_tong_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 string $goods_name 商品名称
- * @property int $cate_one 一级类目
- * @property int $cate_two 二级类目
- * @property int $cate_three 三级类目
- * @property int $import_at 导入时间
- * @property int $can_sale 导入时间
- * @property float $gonghuojia 供货价
- * @property float $price 零售价
- * @property float $retail_price 零售价
- * @property array|null $ship_method 配送方式
- * @property string $default_image 配送方式
- */
- class QiShangTongGoods extends \common\models\base\BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return 'qimall_addons_qi_shang_tong_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', 'can_sale'], 'integer'],
- [['content', 'ship_method'], 'safe'],
- [['retail_price', 'price', 'gonghuojia'], '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',
- 'import_at' => 'Import At',
- 'cost_price' => 'Cost Price',
- 'price' => 'Price',
- 'ship_method' => 'Ship Method',
- ];
- }
- public function getCateOne()
- {
- return $this->hasOne(QiShangTongCate::class, ['third_cate_id' => 'cate_one']);
- }
- public function getCateTwo()
- {
- return $this->hasOne(QiShangTongCate::class, ['third_cate_id' => 'cate_two']);
- }
- }
|