完成上传组件的开发

This commit is contained in:
2020-04-10 21:19:03 +08:00
parent 5629daa722
commit a5a9c12ad0
18 changed files with 385 additions and 145 deletions

View File

@@ -15,10 +15,22 @@ namespace app\model;
class Wechat extends \think\Model {
public static $fieldlist = [
['name' => 'name', 'title' => '名称', 'type' => 'text', 'help' => '微信名称'],
['name' => 'app_id', 'title' => '微信APPID', 'type' => 'text', 'help' => 'AppID'],
['name' => 'title', 'title' => '名称', 'type' => 'text', 'is_must' => 1, 'help' => '微信名称'],
['name' => 'type', 'title' => '微信类型', 'type' => 'select', 'is_must' => 1, 'option' => [['key' => 1, 'label' => '公众号'],['key' => 2, 'label' => '小程序'],['key' => 3, 'label' => '企业号']], 'help' => 'AppID'],
['name' => 'app_id', 'title' => '微信APPID', 'type' => 'text', 'is_must' => 1, 'help' => 'AppID'],
['name' => 'secret', 'title' => '微信秘钥', 'type' => 'text', 'help' => 'AppSecret'],
['name' => 'token', 'title' => '微信Token', 'type' => 'text', 'help' => 'Token'],
['name' => 'aes_key', 'title' => 'EncodingAESKey', 'type' => 'text', 'help' => 'EncodingAESKey兼容与安全模式下请一定要填写'],
];
protected function getTypeTextAttr($value, $data){
$type = self::$fieldlist[1]['option'];
$type_text = "";
foreach($type as $val){
if($data['type'] && $data['type'] == $val['key']){
$type_text = $val['label'];
}
}
return $type_text;
}
}

25
app/model/WechatPay.php Normal file
View File

@@ -0,0 +1,25 @@
<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace app\model;
/**
* 微信模型
*/
class WechatPay extends \think\Model {
public static $fieldlist = [
['name' => 'app_id', 'title' => '微信APPID', 'type' => 'text', 'is_must' => 1, 'help' => 'AppID'],
['name' => 'mch_id', 'title' => '商户ID', 'type' => 'text', 'is_must' => 1, 'help' => '商户ID'],
['name' => 'key', 'title' => 'API秘钥', 'type' => 'text', 'is_must' => 1, 'help' => 'API秘钥'],
['name' => 'cert_path_id', 'title' => '证书', 'type' => 'attach', 'help' => '如需使用敏感接口(如退款、发送红包等)需要配置 API 证书路径(登录商户平台下载 API 证书)'],
['name' => 'key_path_id', 'title' => '证书秘钥', 'type' => 'attach', 'help' => ''],
['name' => 'notify_url', 'title' => '回调地址', 'type' => 'text', 'help' => '你也可以在下单时单独设置来想覆盖它'],
];
}