20], [['change_type'], 'string', 'max' => 12], [['desc', 'source_table', 'from_type'], 'string', 'max' => 255], [['order_no'], 'string', 'max' => 100], [['addon_name'], 'string', 'max' => 64], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'mall_id' => 'Mall ID', 'store_id' => 'Store ID', 'level'=>'Level', 'wallet_type' => 'Wallet Type', 'change_type' => 'Change Type', 'change_num' => 'Change Num', 'after_num' => 'After Num', 'desc' => 'Desc', 'source_table' => 'Source Table', 'source_table_id' => 'Source Table ID', 'from_type' => 'From Type', 'status' => 'Status', 'order_no' => 'Order No', 'created_at' => 'Created At', 'updated_at' => 'Updated At', 'addon_name' => 'Addon Name', ]; } /** * 保存数据 * @param array $params * @return bool */ public static function setData(array $params) { try { $model = new self(); $model->loadDefaultValues(); if (!$model->load($params, '') || !$model->save()){ throw new Exception($model->getErrorMessage()); } return $model; } catch (Exception $e) { self::$static_error = $e->getMessage(); return false; } } }