FormData.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /**
  3. * 厦门云联储网络科技有限公司
  4. * https://www.baokuaiyun.com
  5. * Copyright (c) 2023 爆块云 All rights reserved.
  6. */
  7. namespace app\models;
  8. use Yii;
  9. use yii\behaviors\TimestampBehavior;
  10. use yii\db\ActiveRecord;
  11. /**
  12. * This is the model class for table "{{%form_data}}".
  13. *
  14. * @property integer $id
  15. * @property integer $store_id
  16. * @property integer $goods_id
  17. * @property integer $user_id
  18. * @property integer $saas_user_id
  19. * @property integer $is_delete
  20. * @property integer $status
  21. * @property integer $created_at
  22. * @property integer $updated_at
  23. * @property string $form
  24. */
  25. class FormData extends \yii\db\ActiveRecord
  26. {
  27. const STATUS_WAIT_AUDIT = 0; //未审核
  28. const STATUS_VALID = 1; //已审核
  29. const STATUS_REJECT = 2; //已拒绝
  30. const TYPE_GOODS = 0; //商品
  31. /**
  32. * @inheritdoc
  33. */
  34. public static function tableName()
  35. {
  36. return '{{%form_data}}';
  37. }
  38. public function behaviors()
  39. {
  40. return [
  41. [
  42. 'class' => TimestampBehavior::class,
  43. ]
  44. ];
  45. }
  46. /**
  47. * @inheritdoc
  48. */
  49. public function rules()
  50. {
  51. return [
  52. [['id', 'store_id', 'goods_id', 'user_id', 'saas_user_id', 'is_delete', 'status'], 'integer'],
  53. [['created_at', 'updated_at'], 'safe'],
  54. [['form'], 'string'],
  55. ];
  56. }
  57. public static function getStatusName($status){
  58. $arr = [
  59. self::STATUS_WAIT_AUDIT => '未审核',
  60. self::STATUS_VALID => '已审核',
  61. self::STATUS_REJECT => '已拒绝',
  62. ];
  63. return $arr[$status] ?? '';
  64. }
  65. }