| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?php
- namespace addons\CloudStock\common\models;
- use common\enums\StatusEnum;
- use common\models\base\BaseActiveRecord;
- use Yii;
- /**
- * This is the model class for table "qimall_addons_cloud_stock_fill_order_relation".
- *
- * @property int $id
- * @property int $mall_id 商城id
- * @property int $user_id 补货代理商用户id
- * @property int $order_id 订单id
- * @property int $fill_order_id 补货订单id
- * @property int $status 状态[-1:删除;0:禁用;1启用]
- * @property int $created_at
- * @property int $updated_at
- */
- class CloudStockFillOrderRelation extends BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%addons_cloud_stock_fill_order_relation}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id', 'user_id'], 'required'],
- [['mall_id', 'user_id', 'order_id', 'fill_order_id', 'status', 'created_at', 'updated_at'], 'integer'],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'mall_id' => '商城id',
- 'user_id' => '补货代理商用户id',
- 'order_id' => '订单id',
- 'fill_order_id' => '补货订单id',
- 'status' => '状态[-1:删除;0:禁用;1启用]',
- 'created_at' => 'Created At',
- 'updated_at' => 'Updated At',
- ];
- }
- public static function setData(array $params)
- {
- try {
- $model = new self();
- $model->loadDefaultValues();
- if (!$model->load($params, '')) throw new \Exception($model->getErrorMessage());
- if (!$model->save()) throw new \Exception($model->getErrorMessage());
- return $model;
- } catch (\Exception $e) {
- self::$static_error = $e->getMessage();
- return false;
- }
- }
- }
|