validate_rules.php 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <?php
  2. use app\model\AdminMenuModel;
  3. use app\model\CommonModel;
  4. use app\model\GroupModel;
  5. use app\model\RoleModel;
  6. use app\model\ThemeModel;
  7. return [
  8. //【通用】
  9. 'common' => [
  10. 'keyword|关键字' => 'chsDash|max:100',
  11. 'page|页码' => 'require|number|gt:0',
  12. 'size|每页数量' => 'require|number|elt:100',
  13. 'status|状态' => 'number|in:' . CommonModel::$status_normal . ',' . CommonModel::$status_disable,
  14. 'company_id|企业' => 'number|gt:0',
  15. 'card_id|卡类型' => 'number|gt:0',
  16. ],
  17. //【启禁用】
  18. 'status' => [
  19. 'id' => 'require|number|gt:0',
  20. 'status|状态' => 'require|number|in:' . CommonModel::$status_normal . ',' . CommonModel::$status_disable,
  21. ],
  22. //【登录】
  23. 'login' => [
  24. 'username|用户名' => 'require|max:255',
  25. 'password|密码' => 'require|max:255',
  26. ],
  27. //【版本】
  28. //新增版本
  29. 'createVersion' => [
  30. 'title|版本主题' => 'require|max:255',
  31. 'content|版本内容' => 'require|max:255',
  32. 'version|版本号' => 'require|max:255'
  33. ],
  34. //【菜单】
  35. //添加菜单
  36. 'menuAdd' => [
  37. 'menu_name|菜单名称' => 'require|max:255',
  38. 'menu_url|菜单地址' => 'max:255',
  39. 'menu_route|菜单路由' => 'requireWith:pid|max:255',
  40. 'menu_type|菜单类型' => 'number|in:' . AdminMenuModel::$type_1 . ',' . AdminMenuModel::$type_2,
  41. 'menu_img|菜单图片' => 'max:255',
  42. 'pid|父级id' => 'number|egt:0',
  43. 'private|是否私有' => 'number|in:' . AdminMenuModel::$is_private . ',' . AdminMenuModel::$not_private,
  44. 'weight|权重' => 'number|egt:0',
  45. ],
  46. //编辑菜单
  47. 'menuEdit' => [
  48. 'id' => 'require|number|gt:0',
  49. 'menu_name|菜单名称' => 'require|max:255',
  50. 'menu_url|菜单地址' => 'max:255',
  51. 'menu_route|菜单路由' => 'requireWith:pid|max:255',
  52. 'menu_type|菜单类型' => 'number|in:' . AdminMenuModel::$type_1 . ',' . AdminMenuModel::$type_2,
  53. 'menu_img|菜单图片' => 'max:255',
  54. 'pid|父级id' => 'number|egt:0',
  55. 'private|是否私有' => 'number|in:' . AdminMenuModel::$is_private . ',' . AdminMenuModel::$not_private,
  56. 'is_show|是否显示' => 'number|in:' . AdminMenuModel::$show . ',' . AdminMenuModel::$hide,
  57. 'weight|权重' => 'number|egt:0',
  58. ],
  59. //【视频】
  60. //添加视频
  61. 'videoAdd' => [
  62. 'video_name|视频名称' => 'require|max:255',
  63. 'video_url|视频地址' => 'require|max:255',
  64. 'video_img|视频封面' => 'require|max:255',
  65. 'weight|权重' => 'number|egt:0',
  66. 'remark|备注' => 'max:255',
  67. ],
  68. //编辑视频
  69. 'videoEdit' => [
  70. 'id' => 'require|number|gt:0',
  71. 'video_name|视频名称' => 'require|max:255',
  72. 'video_url|视频地址' => 'require|max:255',
  73. 'video_img|视频封面' => 'require|max:255',
  74. 'weight|权重' => 'number|egt:0',
  75. 'remark|备注' => 'max:255',
  76. ],
  77. //【批量添加视频】
  78. //添加
  79. 'videoGroupAdd' => [
  80. 'group_id|分组id' => 'require|number|gt:0',
  81. 'video_ids|视频id集合' => 'require|array|max:100',
  82. ],
  83. //【卡类型】
  84. //添加卡类型
  85. 'cardAdd' => [
  86. 'title|卡类型' => 'require|max:255'
  87. ],
  88. //编辑卡类型
  89. 'cardEdit' => [
  90. 'id' => 'require|number|gt:0',
  91. 'title|卡类型' => 'require|max:255'
  92. ],
  93. //【企业】
  94. //添加
  95. 'CompanyAdd' => [
  96. 'title|企业名称' => 'require|max:255',
  97. 'contacts|联系人' => 'require|max:255',
  98. 'mobile|联系方式' => 'require|mobile',
  99. 'remark|备注' => 'max:255',
  100. ],
  101. //【权限】
  102. 'actionAdd' => [
  103. 'menuid' => 'require|number|gt:0',
  104. 'action_code' => 'require|max:255',
  105. 'status|状态' => 'require|number|in:' . CommonModel::$status_normal . ',' . CommonModel::$status_disable,
  106. ],
  107. //【角色】
  108. 'roleList' => [
  109. 'name|角色名称' => 'max:255',
  110. 'level|角色等级' => 'number|in:' . implode(',', [RoleModel::$level_super_administrator, RoleModel::$level_administrator, RoleModel::$level_normal_role]),
  111. ],
  112. 'RoleAdd' => [
  113. 'name|角色名称' => 'require|max:255',
  114. 'level|角色等级' => 'require|number|in:' . implode(',', [RoleModel::$level_super_administrator, RoleModel::$level_administrator, RoleModel::$level_normal_role]),
  115. 'remark|备注' => 'max:255',
  116. 'action_data|功能权限' => 'require|array'
  117. ],
  118. //运营账号
  119. 'adminAdd' => [
  120. 'username|账号' => 'require|max:255',
  121. 'role_id|角色' => 'require|number|gt:0',
  122. 'card_id|卡类型' => 'require|array|max:100',
  123. ],
  124. //更改密码
  125. 'adminChangePasswod' => [
  126. 'id' => 'require|number|gt:0',
  127. 'new_password|新密码' => 'require|min:6|max:255',
  128. ],
  129. //【企业和卡类型组合】
  130. //添加
  131. 'GroupAdd' => [
  132. 'company_id|企业id' => 'require|number|gt:0',
  133. 'card_id|卡类型id' => 'require|number|gt:0',
  134. 'remark|备注' => 'max:255',
  135. ],
  136. //【公司商品】
  137. //添加
  138. 'CompanyGoodAdd' => [
  139. 'group_id|分组id' => 'require|number|gt:0',
  140. 'good_id|商品id' => 'require|array|max:100',
  141. ],
  142. //【商城商品库存】
  143. //添加
  144. 'InventoryShoppingAdd' => [
  145. 'list|商城商品库存列表' => 'require|array|max:100',
  146. ],
  147. //【兑换商品库存】
  148. //添加
  149. 'InventoryExchangeAdd' => [
  150. 'group_id|分组id' => 'require|number|gt:0',
  151. 'list|兑换商品库存列表' => 'require|array|max:100',
  152. ],
  153. //【账户】
  154. //添加
  155. 'AccountAdd' => [
  156. 'company_id|企业' => 'require|number|gt:0',
  157. 'card_id|卡类型' => 'require|number|gt:0',
  158. 'username|账户' => 'require|max:255',
  159. 'starttime|开始日期' => 'require|date|lt:expiretime',
  160. 'expiretime|结束日期' => 'require|date|gt:starttime',
  161. 'video_ids|视频id集合' => 'require|array|max:100',
  162. 'mobile|手机号' => 'mobile',
  163. 'name|姓名' => 'max:255',
  164. 'remark|备注' => 'max:255',
  165. ],
  166. //批量添加账户
  167. 'AccountBatchAdd' => [
  168. 'company_id|企业' => 'require|number|gt:0',
  169. 'card_id|卡类型' => 'require|number|gt:0',
  170. 'username_prefix|账户前缀' => 'require|max:255',
  171. 'username_year|账户年份' => 'require|number|length:2,4',
  172. 'starttime|开始日期' => 'require|date|lt:expiretime',
  173. 'expiretime|结束日期' => 'require|date|gt:starttime',
  174. ],
  175. //【服务】
  176. //添加
  177. 'ServiceAdd' => [
  178. 'company_id|企业' => 'require|number|gt:0',
  179. 'card_id|卡类型' => 'number|require|gt:0',
  180. 'original_price|原价' => 'require|float|gt:0|max:99999999.99',
  181. 'activity_price|活动价' => 'require|float|gt:0|max:99999999.99',
  182. 'title|服务名称' => 'require|max:255',
  183. 'content|服务介绍' => 'require|max:255',
  184. 'starttime|活动开始时间' => 'require|date|lt:endtime',
  185. 'endtime|活动结束时间' => 'require|date|gt:starttime',
  186. 'expiretime|服务到期时间' => 'require|date',
  187. 'remark|备注' => 'max:255',
  188. ],
  189. //【手机主题】
  190. //添加
  191. 'ThemeAdd' => [
  192. 'group_id|分组id' => 'require|number|gt:0',
  193. 'code|主题编号' => 'require|max:255',
  194. 'modular|模块' => 'require|array|length:4',
  195. ],
  196. //手机主题数据
  197. 'ThemeDataAdd' => [
  198. 'img|图片' => 'require|max:255',
  199. 'jump_type|跳转类型' => 'require|number|in:' . ThemeModel::$jump_type_external . ',' . ThemeModel::$jump_type_inside . ',' . ThemeModel::$jump_type_no,
  200. 'jump_param|跳转参数' => 'max:255',
  201. 'good_id|商品id' => 'number|gt:0'
  202. ],
  203. ];