QiShangTongError.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. namespace addons\QiShangTong\common\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "qimall_addons_qi_shang_tong_error".
  6. *
  7. * @property int $id ID
  8. * @property int $mall_id 商城ID
  9. * @property int $created_at 创建时间
  10. * @property int $updated_at 更新时间
  11. * @property array|null $content 最后一次更新数据
  12. * @property array|null $post 请求数据
  13. * @property string $route 路由
  14. */
  15. class QiShangTongError extends \common\models\base\BaseActiveRecord
  16. {
  17. /**
  18. * {@inheritdoc}
  19. */
  20. public static function tableName()
  21. {
  22. return 'qimall_addons_qi_shang_tong_error';
  23. }
  24. /**
  25. * {@inheritdoc}
  26. */
  27. public function rules()
  28. {
  29. return [
  30. [['mall_id', 'created_at', 'updated_at'], 'integer'],
  31. [['content', 'post'], 'safe'],
  32. [['route'], 'string', 'max' => 1000],
  33. ];
  34. }
  35. /**
  36. * {@inheritdoc}
  37. */
  38. public function attributeLabels()
  39. {
  40. return [
  41. 'id' => 'ID',
  42. 'mall_id' => 'Mall ID',
  43. 'created_at' => 'Created At',
  44. 'updated_at' => 'Updated At',
  45. 'content' => 'Content',
  46. 'post' => 'Post',
  47. 'route' => 'Route',
  48. ];
  49. }
  50. public static function setData(array $params)
  51. {
  52. $model = new self();
  53. $model->loadDefaultValues();
  54. if (!$model->load($params, '') || !$model->save()) {
  55. Yii::error($model->getErrorMessage() . " == " . __METHOD__);
  56. }
  57. }
  58. }