MdGroupDriver.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. /**
  3. * MdGroupDriver.php
  4. * todo 文件描述
  5. * Created on 2024/3/22 12:00
  6. * @author: hankaige
  7. */
  8. namespace app\models;
  9. use yii\behaviors\TimestampBehavior;
  10. use yii\db\ActiveRecord;
  11. /**
  12. * This is the model class for table "{{%md_setting}}".
  13. * @property integer $id
  14. * @property integer $store_id
  15. * @property integer $code
  16. * @property integer $name
  17. * @property integer $mobile
  18. * @property integer $status
  19. * @property integer $created_at
  20. * @property integer $updated_at
  21. * @property integer $is_delete
  22. */
  23. class MdGroupDriver extends \yii\db\ActiveRecord
  24. {
  25. const STATUS_TRUE = 1;
  26. const STATUS_FALSE = 0;
  27. public static function tableName()
  28. {
  29. return "{{%md_group_driver}}";
  30. }
  31. public function behaviors()
  32. {
  33. return [
  34. [
  35. 'class' => TimestampBehavior::class,
  36. 'attributes' => [
  37. ActiveRecord::EVENT_BEFORE_INSERT => ['created_at'],
  38. ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at']
  39. ]
  40. ]
  41. ];
  42. }
  43. public function rules()
  44. {
  45. return [
  46. [
  47. [
  48. 'store_id',
  49. 'code',
  50. 'name',
  51. 'mobile'
  52. ],
  53. 'required'
  54. ],
  55. [
  56. [
  57. 'store_id',
  58. 'status'
  59. ],
  60. 'integer'
  61. ],
  62. [
  63. [
  64. 'code',
  65. 'name',
  66. 'mobile'
  67. ],
  68. 'string'
  69. ]
  70. ];
  71. }
  72. public function attributeLabels()
  73. {
  74. return [
  75. 'store_id' => '商城ID',
  76. 'code' => '司机编号',
  77. 'name' => '司机姓名',
  78. 'mobile' => '司机手机号',
  79. 'status' => '司机状态'
  80. ];
  81. }
  82. }