| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <?php
- namespace addons\QiShangTong\common\models;
- use Yii;
- /**
- * This is the model class for table "qimall_addons_qi_shang_tong_goods_attr".
- *
- * @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 float $cost_price 供货价
- * @property float $price 零售价
- * @property float $original_price 划线价
- * @property float $third_price 划线价
- * @property float $gonghuojia 划线价
- * @property float $retail_price 划线价
- * @property int $third_spec_id 第三方规格ID
- * @property int $goods_attr_id 本地商品规格ID
- * @property string $sign_id 本地唯一值
- */
- class QiShangTongGoodsAttr extends \common\models\base\BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return 'qimall_addons_qi_shang_tong_goods_attr';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id', 'created_at', 'updated_at', 'status', 'goods_id', 'third_goods_id', 'third_spec_id', 'goods_attr_id'], 'integer'],
- [['cost_price', 'price', 'original_price', 'retail_price', 'gonghuojia', 'third_price'], 'number'],
- [['sign_id'], 'string', 'max' => 50],
- ];
- }
- /**
- * {@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',
- 'cost_price' => 'Cost Price',
- 'price' => 'Price',
- 'original_price' => 'Original Price',
- 'third_spec_id' => 'Third Spec ID',
- 'goods_attr_id' => 'Goods Attr ID',
- 'sign_id' => 'Sign ID',
- ];
- }
- public static function setData(array $params)
- {
- $model = new self();
- $model->loadDefaultValues();
- $model->load($params, '');
- if (!$model->save()) throw new \Exception($model->getErrorMessage());
- }
- }
|