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.

93 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. [['province', 'city', 'area', 'taking_site'], 'string'],
  40. [['billing_type', 'extra_weight_type', 'exemption_type', 'basic_price', 'extra_price', 'exemption_amount', 'support_taking'], 'integer'],
  41. [['name'], 'string', 'max' => 255],
  42. ];
  43. }
  44. /**
  45. * {@inheritdoc}
  46. */
  47. public function attributeLabels()
  48. {
  49. return [
  50. 'id' => 'id',
  51. 'name' => '名称',
  52. 'province' => '省份',
  53. 'city' => '城市',
  54. 'area' => '区域',
  55. 'billing_type' => '账单类型',
  56. 'extra_weight_type' => '续重重量类型',
  57. 'exemption_type' => '包邮类型',
  58. 'basic_price' => '基本运费',
  59. 'extra_price' => '续重运费',
  60. 'exemption_amount' => '包邮金额',
  61. 'support_taking' => '是否支持自提,1为不支持',
  62. 'taking_site' => '自提地点',
  63. 'updated_at' => '更新时间',
  64. 'created_at' => '创建时间',
  65. ];
  66. }
  67. /**
  68. * @author linyao
  69. * @email 602604991@qq.com
  70. * @created Nov 8, 2019
  71. *
  72. * 行为存储创建时间和更新时间
  73. */
  74. public function behaviors()
  75. {
  76. return [
  77. [
  78. 'class' => TimestampBehavior::className(),
  79. 'createdAtAttribute' => 'created_at',
  80. 'updatedAtAttribute' => 'updated_at',
  81. 'value' => function() {
  82. return time();
  83. },
  84. ],
  85. ];
  86. }
  87. }