app_func.php 4.2 KB

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