EventSignStaff.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. namespace app\models;
  3. use Yii;
  4. use yii\behaviors\TimestampBehavior;
  5. /**
  6. * This is the model class for table "event_sign_staff".
  7. *
  8. * @property int $id
  9. * @property int|null $store_id 商城ID
  10. * @property int|null $created_at
  11. * @property int|null $updated_at
  12. * @property int|null $is_delete 是否删除:0=否;1=是;
  13. * @property int|null $user_id 签到员user_id,关联user表
  14. * @property string|null $mobile 手机号
  15. * @property string|null $name 姓名
  16. *
  17. * @property EventSignLog[] $signLogs
  18. */
  19. class EventSignStaff extends \yii\db\ActiveRecord
  20. {
  21. public static function tableName()
  22. {
  23. return 'cyy_event_sign_staff';
  24. }
  25. public function behaviors()
  26. {
  27. return [
  28. [
  29. // 自动更新创建和更新时间
  30. 'class' => TimestampBehavior::class,
  31. 'value' => time()
  32. ]
  33. ];
  34. }
  35. public function rules()
  36. {
  37. return [
  38. [['store_id', 'created_at', 'updated_at', 'is_delete', 'user_id'], 'integer'],
  39. [['mobile'], 'string', 'max' => 20],
  40. [['name'], 'string', 'max' => 255],
  41. ];
  42. }
  43. public function attributeLabels()
  44. {
  45. return [
  46. 'id' => 'ID',
  47. 'store_id' => '商城ID',
  48. 'created_at' => '创建时间',
  49. 'updated_at' => '更新时间',
  50. 'is_delete' => '是否删除',
  51. 'user_id' => '签到员用户ID',
  52. 'mobile' => '手机号',
  53. 'name' => '姓名',
  54. ];
  55. }
  56. public function getSignLogs()
  57. {
  58. return $this->hasMany(EventSignLog::class, ['staff_id' => 'id']);
  59. }
  60. }