app_func.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?php
  2. return [
  3. 'list' => [
  4. 'where' => ['app_id'],
  5. 'field' => [
  6. 'id',
  7. 'name',
  8. 'key',
  9. 'type',
  10. 'status' => [
  11. 'type' => 'switch',
  12. 'show' => '{status}',
  13. 'active_value' => 1,
  14. 'inactive_value' => 2,
  15. ],
  16. 'cdate',
  17. ],
  18. 'data_button' => [
  19. '编辑' => ['edit'],
  20. ],
  21. 'button' => [
  22. '新增' => ['add'],
  23. ],
  24. 'search' => [
  25. 'app_id' => 'hidden',
  26. 'name',
  27. 'key',
  28. 'type',
  29. ],
  30. ],
  31. 'update' => [
  32. 'end' => 'Api/Lib/App.update',
  33. 'tab' => [
  34. '基本设置' => 'app_id,name,key,desc,cron_date,cron_time',
  35. '接口设置' => 'type,api/app_func_work',
  36. '价格设置' => 'spec_type,api/sku,api/sku#',
  37. '输入输出' => 'api/app_func_input,api/app_func_output',
  38. ],
  39. 'field' => [
  40. 'app_id' => 'hidden',
  41. 'name',
  42. 'type',
  43. 'key' => [
  44. 'tip' => '如果为空,将自动按照名称拼音生成',
  45. ],
  46. 'desc' => 'textarea',
  47. 'status' => [
  48. 'type' => 'radio',
  49. ],
  50. 'cron_date' => [
  51. 'type' => 'date',
  52. 'date_type' => 'datetime',
  53. ],
  54. 'cron_time' => [
  55. 'type' => 'text',
  56. 'desc' => '直接输入秒数,如60,就是间隔60秒执行一次,为0则不定时执行',
  57. ],
  58. 'api/app_func_work' => [
  59. 'name' => '功能接口',
  60. 'desc' => '设置功能包含的接口',
  61. 'where' => ['app_func_id' => 'id'],
  62. ],
  63. 'spec_type' => [
  64. 'type' => 'radio',
  65. 'control' => true,
  66. ],
  67. 'api/sku' => [
  68. 'name' => '单规格设置',
  69. 'where' => ['app_func_id' => 'id', 'key' => '-1'],
  70. # 默认值,如果有默认值则无法添加和删除
  71. 'default' => [
  72. # 默认值
  73. [
  74. 'key' => '-1',
  75. 'price' => '',
  76. 'num' => '',
  77. 'day_num' => '',
  78. ],
  79. ],
  80. ],
  81. 'api/sku#' => [
  82. 'name' => '多规格设置',
  83. 'where' => ['app_func_id' => 'id', 'key' => ['!=', '-1']],
  84. 'type' => 'sku',
  85. # 设置规格表名
  86. 'spec' => 'api/spec',
  87. # 设置规格表关联字段
  88. 'spec_field' => 'app_func_id',
  89. # 获取规格数据的接口
  90. 'spec_data' => 'Api/Lib/Spec.manage',
  91. ],
  92. 'api/app_func_input' => [
  93. 'name' => '参数输入',
  94. 'where' => ['app_func_id' => 'id'],
  95. 'desc' => '[参数名:对应接口中的请求参数名,默认值/可选项:可以多行输入,默认值为第一行,其他行为可选项]',
  96. ],
  97. 'api/app_func_output' => [
  98. 'name' => '参数输出',
  99. 'where' => ['app_func_id' => 'id'],
  100. ],
  101. ],
  102. 'control' => [
  103. 'api/sku' => [
  104. 'spec_type' => 2,
  105. ],
  106. 'api/sku#' => [
  107. 'spec_type' => 3,
  108. ],
  109. ],
  110. ],
  111. ];