account.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?php
  2. $account_id = Dever::input('id');
  3. $show = false;
  4. $account_setting = array();
  5. if ($account_id) {
  6. $account = Dever::db('account', 'api')->find($account_id);
  7. $setting = Dever::db('platform_setting', 'api')->select(array('platform_id' => $account['platform_id']));
  8. if ($setting) {
  9. $show = true;
  10. foreach ($setting as $k => $v) {
  11. $account_setting[] = array('platform_setting_name' => $v['name'], 'platform_setting_id' => $v['id'], 'value' => '');
  12. }
  13. }
  14. }
  15. return array
  16. (
  17. 'list' => array
  18. (
  19. 'field' => array
  20. (
  21. 'id',
  22. 'name',
  23. 'key',
  24. 'app_id' => array
  25. (
  26. 'show' => 'Dever::call("api/app-find", "{app_id}")["name"]',
  27. ),
  28. 'platform_id' => array
  29. (
  30. 'show' => 'Dever::call("api/platform-find", "{platform_id}")["name"]',
  31. ),
  32. 'cdate',
  33. ),
  34. 'button' => array
  35. (
  36. '新增' => array('fastadd', 'name,key,app_platform'),
  37. ),
  38. 'data_button' => array
  39. (
  40. '设置' => array('edit', 'name,key,app_platform_name,api/account_setting'),
  41. '证书' => array('route', array
  42. (
  43. 'path' => 'api_manage/account_cert',
  44. 'param' => array
  45. (
  46. 'set' => array('account_id' => 'id', 'menu' => 'api_manage/account', 'parent' => 'api_manage/account'),
  47. ),
  48. )),
  49. ),
  50. 'search' => array
  51. (
  52. 'name',
  53. 'key',
  54. 'app_platform' => array
  55. (
  56. 'type' => 'cascader',
  57. 'remote' => 'api/manage.getAppPlatform',
  58. ),
  59. ),
  60. ),
  61. 'update' => array
  62. (
  63. 'field' => array
  64. (
  65. 'name' => array
  66. (
  67. 'rules' => true,
  68. ),
  69. 'key',
  70. 'app_platform' => array
  71. (
  72. 'desc' => '【提交后不能更改】',
  73. 'rules' => true,
  74. 'type' => 'cascader',
  75. 'remote' => 'api/manage.getAppPlatform',
  76. 'remote_default' => false,
  77. ),
  78. 'app_platform_name' => array
  79. (
  80. 'name' => '平台与应用',
  81. 'type' => 'show',
  82. 'default' => 'Dever::call("api/app.getAppPlatform", array("{app_id}", "{platform_id}"))',
  83. ),
  84. 'api/account_setting' => array
  85. (
  86. 'show' => $show,
  87. 'name' => '平台参数配置',
  88. 'where' => array('account_id' => 'id'),
  89. 'default' => $account_setting,
  90. ),
  91. ),
  92. 'check' => 'key',
  93. 'start' => array('manage/common.updateKey', 'api/account.update'),
  94. ),
  95. );