| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242 | 
							- <?php
 
- $platform = include('platform.php');
 
- $config = array
 
- (
 
-     'list' => array
 
-     (
 
-         'field'      => array
 
-         (
 
-             'id',
 
-             'name',
 
-             'uri',
 
-             'env_type',
 
-             'cate' => array
 
-             (
 
-                 'show' => 'Dever::call("content/cate.getInfo", array("api", "{cate}"))',
 
-             ),
 
-             'platform_id',
 
-             'status' => array
 
-             (
 
-                 'type' => 'switch',
 
-                 'show'  => '{status}',
 
-                 'active_value' => 1,
 
-                 'inactive_value' => 2,
 
-             ),
 
-         ),
 
-         'data_button' => array
 
-         (
 
-             '设置' => 'edit',
 
-             '删除' => 'delete',
 
-         ),
 
-         'button' => array
 
-         (
 
-             '新增' => array('fastadd', 'name,env_type,cate,platform_id,uri'),
 
-         ),
 
-         'search' => array
 
-         (
 
-             'platform_id',
 
-             'cate' => array
 
-             (
 
-                 'type' => 'cascader',
 
-                 'option'    => 'Dever::call("content/cate.getList", array("api"))',
 
-             ),
 
-             'name',
 
-             'uri',
 
-             'status',
 
-         ),
 
-     ),
 
-     'update' => array
 
-     (
 
-         'desc' => $platform['update']['desc'],
 
-         'end' => 'content/info.update',
 
-         'tab' => array
 
-         (
 
-             '基本设置' => 'name,env_type,cate,sign_col,uri,api/api_uri',
 
-             '价格设置' => 'spec_type,api/sku,api/sku#',
 
-             '请求参数' => 'method,post_method,api/api_request_header,api/api_request_body',
 
-             '响应参数' => 'api/api_response_header,api/api_response_body',
 
-             
 
-             '输入输出' => 'api/api_request_input,api/api_request_output',
 
-             '存储设置' => 'api/api_save',
 
-             '回调设置' => 'notify_type,notify_success,notify_error,api/api_notify_code',
 
-         ),
 
-         'field'    => array
 
-         (
 
-             'name',
 
-             'env_type' => 'radio',
 
-             'cate' => array
 
-             (
 
-                 'type' => 'cascader',
 
-                 'option'    => 'Dever::call("content/cate.getList", array("api"))',
 
-             ),
 
-             'platform_id' => array
 
-             (
 
-                 'desc' => '【提交后不能更改】',
 
-             ),
 
-             'sign_col' => array
 
-             (
 
-                 'type' => 'textarea',
 
-                 'autosize' => array('minRows' => 2),
 
-                 'desc' => '按顺序做加密,用+号隔开,为空则所有字段均参与加密,这里填写后,将替换平台中的签名加密参数',
 
-             ),
 
-             'uri',
 
-             'api/api_uri' => array
 
-             (
 
-                 'name' => '接口地址生成',
 
-                 'where'  => array('api_id' => 'id'),
 
-                 'desc' => '如果需要动态生成接口地址,这里填写参数即可,同样支持变量',
 
-             ),
 
-             'method' => array
 
-             (
 
-                 'type' => 'radio',
 
-                 'control' => true,
 
-             ),
 
-             'post_method' => array
 
-             (
 
-                 'type' => 'radio',
 
-                 'show' => false,
 
-             ),
 
-             'api/api_request_input' => array
 
-             (
 
-                 'name' => '参数输入',
 
-                 'where'  => array('api_id' => 'id'),
 
-                 'desc' => '[默认值/可选项:可以多行输入,默认值为第一行,其他行为可选项]',
 
-             ),
 
-             'api/api_request_output' => array
 
-             (
 
-                 'name' => '参数输出',
 
-                 'where'  => array('api_id' => 'id'),
 
-             ),
 
-             'api/api_request_body' => array
 
-             (
 
-                 'name' => '请求体',
 
-                 'where'  => array('api_id' => 'id'),
 
-             ),
 
-             'api/api_request_header' => array
 
-             (
 
-                 'name' => '请求头',
 
-                 'where'  => array('api_id' => 'id'),
 
-             ),
 
-             'api/api_response_body' => array
 
-             (
 
-                 'name' => '响应体',
 
-                 'desc' => '填写后,平台中的标准响应体将失效,并且只保留填写后的响应体,格式:data[].name,不是列表则为data.name',
 
-                 'where'  => array('api_id' => 'id'),
 
-             ),
 
-             'api/api_response_header' => array
 
-             (
 
-                 'name' => '响应头',
 
-                 'desc' => '填写后,平台中的标准响应头将失效,不填写不保留响应头,格式:data[].name,不是列表则为data.name',
 
-                 'where'  => array('api_id' => 'id'),
 
-             ),
 
-             'api/api_save' => array
 
-             (
 
-                 'name' => '存储设置',
 
-                 'desc' => '用于将响应数据保存到数据表中,该数据表最好有api_id(int)和request_id(varchar)字段,用于区分是哪个接口哪次请求,当然也可以没有',
 
-                 'where'  => array('api_id' => 'id'),
 
-             ),
 
-             'notify_type' => array
 
-             (
 
-                 'type' => 'radio',
 
-                 'control' => true,
 
-             ),
 
-             'notify_success' => array
 
-             (
 
-                 'desc' => '填写回调成功后,返回给渠道的信息',
 
-             ),
 
-             'notify_error' => array
 
-             (
 
-                 'desc' => '填写回调失败后,返回给渠道的信息,如果填写500,则会返回HTTP Status Code 500,默认返回HTTP Status Code 200',
 
-             ),
 
-             'notify_sign_col' => array
 
-             (
 
-                 'desc' => '回调签名参数,不填写则使用接口的回调签名参数',
 
-             ),
 
-             'api/api_notify_code' => array
 
-             (
 
-                 'name' => '回调状态码',
 
-                 'where'  => array('api_id' => 'id'),
 
-             ),
 
-             'spec_type' => array
 
-             (
 
-                 'type' => 'radio',
 
-                 'control' => true,
 
-             ),
 
-             'api/sku' => array
 
-             (
 
-                 'name' => '单规格设置',
 
-                 'where'  => array('api_id' => 'id', 'key' => '-1'),
 
-                 # 默认值,如果有默认值则无法添加和删除
 
-                 'default' => array
 
-                 (
 
-                     # 默认值
 
-                     array
 
-                     (
 
-                         'price' => '',
 
-                         'num' => '',
 
-                         'day_num' => '',
 
-                     ),
 
-                 ),
 
-             ),
 
-             'api/sku#' => array
 
-             (
 
-                 'name' => '多规格设置',
 
-                 'where' => array('api_id' => 'id', 'key' => array('!=', '-1')),
 
-                 'type' => 'sku',
 
-                 # 设置规格表名
 
-                 'spec' => 'api/spec',
 
-                 # 设置规格表关联字段
 
-                 'spec_field' => 'api_id',
 
-                 # 获取规格数据的接口
 
-                 'spec_data' => 'api/spec.manage',
 
-             ),
 
-         ),
 
-         'control' => array
 
-         (
 
-             'post_method' => array
 
-             (
 
-                 'method' => 2,
 
-             ),
 
-             'notify_success' => array
 
-             (
 
-                 'notify_type' => 1,
 
-             ),
 
-             'notify_error' => array
 
-             (
 
-                 'notify_type' => 1,
 
-             ),
 
-             'api/api_notify_code' => array
 
-             (
 
-                 'notify_type' => 1,
 
-             ),
 
-             /*
 
-             'api/api_notify' => array
 
-             (
 
-                 'notify_type' => 1,
 
-             ),*/
 
-             'api/sku' => array
 
-             (
 
-                 'spec_type' => 1,
 
-             ),
 
-             'api/sku#' => array
 
-             (
 
-                 'spec_type' => 2,
 
-             ),
 
-         ),
 
-     ),
 
- );
 
- $id = Dever::input('id');
 
- if (!$id) {
 
-     unset($config['update']['tab']);
 
- }
 
- return $config;
 
 
  |