app_func.php 3.6 KB

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