| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- namespace addons\CloudStock\common\models;
- use common\models\base\BaseActiveRecord;
- use Yii;
- /**
- * This is the model class for table "qimall_addons_cloud_stock_early_warning_log".
- *
- * @property int $id
- * @property int $mall_id 商城ID
- * @property int $user_id 会员id
- * @property int $goods_id 导入的商品的id
- * @property int $status
- * @property int $updated_at
- * @property int $created_at 添加时间
- */
- class CloudStockEarlyWarningLog extends BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%addons_cloud_stock_early_warning_log}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id', 'user_id', 'goods_id', 'status', 'updated_at', 'created_at'], 'integer'],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'mall_id' => 'Mall ID',
- 'user_id' => 'User ID',
- 'goods_id' => 'Goods ID',
- 'status' => 'Status',
- 'updated_at' => 'Updated At',
- 'created_at' => 'Created At',
- ];
- }
- public static function setData(array $params)
- {
- try {
- $model = new self();
- $model->loadDefaultValues();
- if (!$model->load($params, '') || !$model->save()) throw new \Exception($model->getErrorMessage());
- return true;
- } catch (\Exception $e) {
- self::$static_error = $e->getMessage();
- return false;
- }
- }
- }
|