account.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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'],
  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. ],
  75. 'check' => 'key',
  76. 'start' => ['manage/common.updateKey', 'api/account.update'],
  77. ],
  78. ];