You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
2.6 KiB

  1. <?php
  2. namespace common\models\ars;
  3. use Yii;
  4. use yii\behaviors\TimestampBehavior;
  5. /**
  6. * This is the model class for table "ats_express_template".
  7. *
  8. * @property int $id
  9. * @property string $name 名称
  10. * @property string $province 省份
  11. * @property string $city 城市
  12. * @property string $area 区域
  13. * @property int $billing_type 账单类型
  14. * @property int $extra_weight_type 续重重量类型
  15. * @property int $exemption_type 包邮类型
  16. * @property int $basic_price 基本运费
  17. * @property int $extra_price 续重运费
  18. * @property int $exemption_amount 包邮金额
  19. * @property int $support_taking 是否支持自提,1为不支持
  20. * @property string $taking_site 自提地点
  21. * @property int $updated_at 更新时间
  22. * @property int $created_at 创建时间
  23. */
  24. class ExpressTemplate extends \yii\db\ActiveRecord
  25. {
  26. /**
  27. * {@inheritdoc}
  28. */
  29. public static function tableName()
  30. {
  31. return 'ats_express_template';
  32. }
  33. /**
  34. * {@inheritdoc}
  35. */
  36. public function rules()
  37. {
  38. return [
  39. [['name'], 'required'],
  40. [['province', 'city', 'area', 'taking_site'], 'string'],
  41. [['billing_type', 'extra_weight_type', 'exemption_type', 'basic_price', 'extra_price', 'exemption_amount', 'support_taking'], 'integer'],
  42. [['name'], 'string', 'max' => 255],
  43. ];
  44. }
  45. /**
  46. * {@inheritdoc}
  47. */
  48. public function attributeLabels()
  49. {
  50. return [
  51. 'id' => 'id',
  52. 'name' => '名称',
  53. 'province' => '省份',
  54. 'city' => '城市',
  55. 'area' => '区域',
  56. 'billing_type' => '账单类型',
  57. 'extra_weight_type' => '续重重量类型',
  58. 'exemption_type' => '包邮类型',
  59. 'basic_price' => '基本运费',
  60. 'extra_price' => '续重运费',
  61. 'exemption_amount' => '包邮金额',
  62. 'support_taking' => '是否支持自提,1为不支持',
  63. 'taking_site' => '自提地点',
  64. 'updated_at' => '更新时间',
  65. 'created_at' => '创建时间',
  66. ];
  67. }
  68. /**
  69. * @author linyao
  70. * @email 602604991@qq.com
  71. * @created Nov 8, 2019
  72. *
  73. * 行为存储创建时间和更新时间
  74. */
  75. public function behaviors()
  76. {
  77. return [
  78. [
  79. 'class' => TimestampBehavior::className(),
  80. 'createdAtAttribute' => 'created_at',
  81. 'updatedAtAttribute' => 'updated_at',
  82. 'value' => function() {
  83. return time();
  84. },
  85. ],
  86. ];
  87. }
  88. }