account.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?php
  2. $account_id = Dever::input('id');
  3. $show = false;
  4. $account_setting = [];
  5. if ($account_id) {
  6. $account = Dever::db('api/account')->find($account_id);
  7. $setting = Dever::db('api/platform_setting')->select(['platform_id' => $account['platform_id']]);
  8. if ($setting) {
  9. $show = true;
  10. foreach ($setting as $k => $v) {
  11. $account_setting[] = ['platform_setting_name' => $v['name'], 'platform_setting_id' => $v['id'], 'value' => ''];
  12. }
  13. }
  14. }
  15. return [
  16. 'list' => [
  17. 'field' => [
  18. 'id',
  19. 'name',
  20. 'key',
  21. 'app_id' => [
  22. 'show' => 'Dever::db("api/app")->find("{app_id}")["name"]',
  23. ],
  24. 'platform_id' => [
  25. 'show' => 'Dever::db("api/platform")->find("{platform_id}")["name"]',
  26. ],
  27. 'sync' => [
  28. 'type' => 'switch',
  29. 'show' => '{sync}',
  30. 'active_value' => 1,
  31. 'inactive_value' => 2,
  32. ],
  33. 'cdate',
  34. ],
  35. 'button' => [
  36. '新增' => ['fastadd', 'name,key,sync,app_platform'],
  37. ],
  38. 'data_button' => [
  39. '设置' => ['edit', 'name,key,sync,app_platform_name,api/account_setting,desc'],
  40. '证书' => ['route', [
  41. 'path' => 'api_manage/account_cert',
  42. 'param' => [
  43. 'set' => ['account_id' => 'id', 'menu' => 'api_manage/account', 'parent' => 'api_manage/account'],
  44. ],
  45. ]],
  46. ],
  47. 'search' => [
  48. 'name',
  49. 'key',
  50. 'app_platform' => [
  51. 'type' => 'cascader',
  52. 'remote' => 'Api/Api/Manage.getAppPlatform',
  53. ],
  54. ],
  55. ],
  56. 'update' => [
  57. 'field' => [
  58. 'name' => [
  59. 'rules' => true,
  60. ],
  61. 'key',
  62. 'sync' => [
  63. 'type' => 'radio',
  64. 'tip' => '开启后,子系统会自动同步该账户的设定,填入相应的子系统账户信息',
  65. ],
  66. 'app_platform' => [
  67. 'desc' => '【提交后不能更改】',
  68. 'rules' => true,
  69. 'type' => 'cascader',
  70. 'remote' => 'Api/Api/Manage.getAppPlatform',
  71. 'remote_default' => false,
  72. ],
  73. 'app_platform_name' => [
  74. 'name' => '平台与应用',
  75. 'type' => 'show',
  76. 'default' => 'Dever::call("Api/Lib/App.getAppPlatform", ["{app_id}", "{platform_id}"])',
  77. ],
  78. 'api/account_setting' => [
  79. 'show' => $show,
  80. 'name' => '平台参数配置',
  81. 'where' => ['account_id' => 'id'],
  82. 'default' => $account_setting,
  83. ],
  84. 'desc' => [
  85. 'desc' => '如果该账户要推给客户使用,需要加一下介绍说明,方便客户填写参数配置',
  86. 'type' => 'textarea',
  87. 'autosize' => ['minRows' => 4],
  88. 'type' => 'editor',
  89. 'editorMenu' => [
  90. 'uploadImage' => 1,
  91. 'uploadVideo' => 3,
  92. ],
  93. ],
  94. ],
  95. 'check' => 'key',
  96. 'start' => ['Manage/Lib/Util.updateKey', 'Api/Lib/Account.update'],
  97. ],
  98. ];