ShopAddressValidate.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace app\workerapi\validate\shops;
  3. use app\common\validate\BaseValidate;
  4. class ShopAddressValidate extends BaseValidate
  5. {
  6. protected $rule = [
  7. 'id' => 'require',
  8. 'worker_id' => 'require',
  9. 'area' => 'require',
  10. 'address' => 'require',
  11. 'house_number' => 'require',
  12. 'contact_number' => 'require',
  13. 'contact_people' => 'require',
  14. ];
  15. /**
  16. * 参数描述
  17. * @var string[]
  18. */
  19. protected $field = [
  20. 'id' => 'id',
  21. 'worker_id' => '用户ID',
  22. 'area' => '城市',
  23. 'address' => '具体地址',
  24. 'house_number' => '门牌号',
  25. 'contact_number' => '联系号码',
  26. 'contact_people' => '联系人',
  27. ];
  28. public function sceneAdd()
  29. {
  30. return $this->only(['worker_id','area','address','house_number','contact_number','contact_people']);
  31. }
  32. public function sceneEdit()
  33. {
  34. return $this->only(['id','worker_id','area','address','house_number','contact_number','contact_people']);
  35. }
  36. public function sceneDelete()
  37. {
  38. return $this->only(['id']);
  39. }
  40. /**
  41. * 获取场景详细信息
  42. *
  43. * 此方法主要用于获取当前场景的唯一标识符
  44. * 它通过仅暴露场景ID来限制返回的信息量,以满足特定需求
  45. *
  46. * @return array 包含场景ID的数组
  47. */
  48. public function sceneDetail()
  49. {
  50. return $this->only(['id']);
  51. }
  52. }