account.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. $account_id = Dever::input('id');
  3. $show = false;
  4. $account_setting = [];
  5. if ($account_id) {
  6. $account = Dever::db('account', 'api')->find($account_id);
  7. $setting = Dever::db('platform_setting', 'api')->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::call("api/app-find", "{app_id}")["name"]',
  23. ],
  24. 'platform_id' => [
  25. 'show' => 'Dever::call("api/platform-find", "{platform_id}")["name"]',
  26. ],
  27. 'cdate',
  28. ],
  29. 'button' => [
  30. '新增' => ['fastadd', 'name,key,app_platform'],
  31. ],
  32. 'data_button' => [
  33. '设置' => ['edit', 'name,key,app_platform_name,api/account_setting,desc'],
  34. '证书' => ['route', [
  35. 'path' => 'api_manage/account_cert',
  36. 'param' => [
  37. 'set' => ['account_id' => 'id', 'menu' => 'api_manage/account', 'parent' => 'api_manage/account'],
  38. ],
  39. ]],
  40. ],
  41. 'search' => [
  42. 'name',
  43. 'key',
  44. 'app_platform' => [
  45. 'type' => 'cascader',
  46. 'remote' => 'api/manage.getAppPlatform',
  47. ],
  48. ],
  49. ],
  50. 'update' => [
  51. 'field' => [
  52. 'name' => [
  53. 'rules' => true,
  54. ],
  55. 'key',
  56. 'app_platform' => [
  57. 'desc' => '【提交后不能更改】',
  58. 'rules' => true,
  59. 'type' => 'cascader',
  60. 'remote' => 'api/manage.getAppPlatform',
  61. 'remote_default' => false,
  62. ],
  63. 'app_platform_name' => [
  64. 'name' => '平台与应用',
  65. 'type' => 'show',
  66. 'default' => 'Dever::call("api/app.getAppPlatform", ["{app_id}", "{platform_id}"])',
  67. ],
  68. 'api/account_setting' => [
  69. 'show' => $show,
  70. 'name' => '平台参数配置',
  71. 'where' => ['account_id' => 'id'],
  72. 'default' => $account_setting,
  73. ],
  74. 'desc' => [
  75. 'desc' => '如果该账户要推给客户使用,需要加一下介绍说明,方便客户填写参数配置',
  76. 'type' => 'textarea',
  77. 'autosize' => ['minRows' => 4],
  78. 'type' => 'editor',
  79. 'editorMenu' => [
  80. 'uploadImage' => 1,
  81. 'uploadVideo' => 3,
  82. ],
  83. ],
  84. ],
  85. 'check' => 'key',
  86. 'start' => ['manage/util.updateKey', 'api/account.update'],
  87. ],
  88. ];