修改字段

This commit is contained in:
邹景立 2021-03-15 10:21:56 +08:00
parent 0b6a9f8f13
commit fa47f17415
8 changed files with 43 additions and 40 deletions

View File

@ -30,7 +30,7 @@ class Login extends Controller
*/ */
protected function initialize() protected function initialize()
{ {
$this->type = input('api', UserService::APITYPE_WAP); $this->type = input('api', UserService::API_TYPE_WAP);
if (empty(UserService::TYPES[$this->type])) { if (empty(UserService::TYPES[$this->type])) {
$this->error("接口通道[{$this->type}]未定义规则!"); $this->error("接口通道[{$this->type}]未定义规则!");
} }

View File

@ -25,7 +25,7 @@ class Wechat extends Controller
* 接口认证类型 * 接口认证类型
* @var string * @var string
*/ */
private $type = UserService::APITYPE_WECHAT; private $type = UserService::API_TYPE_WECHAT;
/** /**
* 唯一绑定字段 * 唯一绑定字段

View File

@ -21,7 +21,7 @@ class Wxapp extends Controller
* 接口认证类型 * 接口认证类型
* @var string * @var string
*/ */
private $type = UserService::APITYPE_WXAPP; private $type = UserService::API_TYPE_WXAPP;
/** /**
* 唯一绑定字段 * 唯一绑定字段

View File

@ -293,7 +293,7 @@ class Order extends Auth
if ($order['payment_status'] > 0) $this->error('已经完成支付'); if ($order['payment_status'] > 0) $this->error('已经完成支付');
try { try {
$openid = ''; $openid = '';
if (in_array($this->type, [UserService::APITYPE_WXAPP, UserService::APITYPE_WECHAT])) { if (in_array($this->type, [UserService::API_TYPE_WXAPP, UserService::API_TYPE_WECHAT])) {
$openid = $this->user[UserService::TYPES[$this->type]['auth']] ?? ''; $openid = $this->user[UserService::TYPES[$this->type]['auth']] ?? '';
if (empty($openid)) $this->error("发起支付失败"); if (empty($openid)) $this->error("发起支付失败");
} }

View File

@ -53,71 +53,71 @@ abstract class PaymentService
'type' => 'BALANCE', 'type' => 'BALANCE',
'name' => '账号余额支付', 'name' => '账号余额支付',
'bind' => [ 'bind' => [
UserService::APITYPE_WAP, UserService::APITYPE_WEB, UserService::API_TYPE_WAP, UserService::API_TYPE_WEB,
UserService::APITYPE_WXAPP, UserService::APITYPE_WECHAT, UserService::API_TYPE_WXAPP, UserService::API_TYPE_WECHAT,
UserService::APITYPE_IOSAPP, UserService::APITYPE_ANDROID, UserService::API_TYPE_IOSAPP, UserService::API_TYPE_ANDROID,
], ],
], ],
self::PAYMENT_VOUCHER => [ self::PAYMENT_VOUCHER => [
'type' => 'VOUCHER', 'type' => 'VOUCHER',
'name' => '单据凭证支付', 'name' => '单据凭证支付',
'bind' => [ 'bind' => [
UserService::APITYPE_WAP, UserService::APITYPE_WEB, UserService::API_TYPE_WAP, UserService::API_TYPE_WEB,
UserService::APITYPE_WXAPP, UserService::APITYPE_WECHAT, UserService::API_TYPE_WXAPP, UserService::API_TYPE_WECHAT,
UserService::APITYPE_IOSAPP, UserService::APITYPE_ANDROID, UserService::API_TYPE_IOSAPP, UserService::API_TYPE_ANDROID,
], ],
], ],
self::PAYMENT_WECHAT_WAP => [ self::PAYMENT_WECHAT_WAP => [
'type' => 'MWEB', 'type' => 'MWEB',
'name' => '微信WAP支付', 'name' => '微信WAP支付',
'bind' => [UserService::APITYPE_WAP], 'bind' => [UserService::API_TYPE_WAP],
], ],
self::PAYMENT_WECHAT_APP => [ self::PAYMENT_WECHAT_APP => [
'type' => 'APP', 'type' => 'APP',
'name' => '微信APP支付', 'name' => '微信APP支付',
'bind' => [UserService::APITYPE_IOSAPP, UserService::APITYPE_ANDROID], 'bind' => [UserService::API_TYPE_IOSAPP, UserService::API_TYPE_ANDROID],
], ],
self::PAYMENT_WECHAT_XCX => [ self::PAYMENT_WECHAT_XCX => [
'type' => 'JSAPI', 'type' => 'JSAPI',
'name' => '微信小程序支付', 'name' => '微信小程序支付',
'bind' => [UserService::APITYPE_WXAPP], 'bind' => [UserService::API_TYPE_WXAPP],
], ],
self::PAYMENT_WECHAT_GZH => [ self::PAYMENT_WECHAT_GZH => [
'type' => 'JSAPI', 'type' => 'JSAPI',
'name' => '微信公众号支付', 'name' => '微信公众号支付',
'bind' => [UserService::APITYPE_WECHAT], 'bind' => [UserService::API_TYPE_WECHAT],
], ],
self::PAYMENT_WECHAT_QRC => [ self::PAYMENT_WECHAT_QRC => [
'type' => 'NATIVE', 'type' => 'NATIVE',
'name' => '微信二维码支付', 'name' => '微信二维码支付',
'bind' => [UserService::APITYPE_WEB], 'bind' => [UserService::API_TYPE_WEB],
], ],
// 支付宝支持配置(不需要的直接注释) // 支付宝支持配置(不需要的直接注释)
self::PAYMENT_ALIPAY_WAP => [ self::PAYMENT_ALIPAY_WAP => [
'type' => '', 'type' => '',
'name' => '支付宝WAP支付', 'name' => '支付宝WAP支付',
'bind' => [UserService::APITYPE_WAP], 'bind' => [UserService::API_TYPE_WAP],
], ],
self::PAYMENT_ALIPAY_WEB => [ self::PAYMENT_ALIPAY_WEB => [
'type' => '', 'type' => '',
'name' => '支付宝WEB支付', 'name' => '支付宝WEB支付',
'bind' => [UserService::APITYPE_WEB], 'bind' => [UserService::API_TYPE_WEB],
], ],
self::PAYMENT_ALIAPY_APP => [ self::PAYMENT_ALIAPY_APP => [
'type' => '', 'type' => '',
'name' => '支付宝APP支付', 'name' => '支付宝APP支付',
'bind' => [UserService::APITYPE_ANDROID, UserService::APITYPE_IOSAPP], 'bind' => [UserService::API_TYPE_ANDROID, UserService::API_TYPE_IOSAPP],
], ],
// 汇聚支持配置(不需要的直接注释) // 汇聚支持配置(不需要的直接注释)
self::PAYMENT_JOINPAY_XCX => [ self::PAYMENT_JOINPAY_XCX => [
'type' => 'WEIXIN_XCX', 'type' => 'WEIXIN_XCX',
'name' => '汇聚小程序支付', 'name' => '汇聚小程序支付',
'bind' => [UserService::APITYPE_WXAPP], 'bind' => [UserService::API_TYPE_WXAPP],
], ],
self::PAYMENT_JOINPAY_GZH => [ self::PAYMENT_JOINPAY_GZH => [
'type' => 'WEIXIN_GZH', 'type' => 'WEIXIN_GZH',
'name' => '汇聚公众号支付', 'name' => '汇聚公众号支付',
'bind' => [UserService::APITYPE_WECHAT], 'bind' => [UserService::API_TYPE_WECHAT],
], ],
]; ];

View File

@ -13,39 +13,39 @@ use think\db\exception\DbException;
*/ */
class UserService extends Service class UserService extends Service
{ {
const APITYPE_WAP = 'wap'; const API_TYPE_WAP = 'wap';
const APITYPE_WEB = 'web'; const API_TYPE_WEB = 'web';
const APITYPE_WXAPP = 'wxapp'; const API_TYPE_WXAPP = 'wxapp';
const APITYPE_WECHAT = 'wechat'; const API_TYPE_WECHAT = 'wechat';
const APITYPE_IOSAPP = 'iosapp'; const API_TYPE_IOSAPP = 'iosapp';
const APITYPE_ANDROID = 'android'; const API_TYPE_ANDROID = 'android';
const TYPES = [ const TYPES = [
// 接口通道配置(不需要的直接注释) // 接口通道配置(不需要的直接注释)
UserService::APITYPE_WAP => [ UserService::API_TYPE_WAP => [
'name' => '手机浏览器', 'name' => '手机浏览器',
'auth' => 'phone', 'auth' => 'phone',
], ],
UserService::APITYPE_WEB => [ UserService::API_TYPE_WEB => [
'name' => '电脑浏览器', 'name' => '电脑浏览器',
'auth' => 'phone', 'auth' => 'phone',
], ],
UserService::APITYPE_IOSAPP => [ UserService::API_TYPE_WXAPP => [
'name' => '苹果应用',
'auth' => 'phone',
],
UserService::APITYPE_ANDROID => [
'name' => '安卓应用',
'auth' => 'phone',
],
UserService::APITYPE_WXAPP => [
'name' => '微信小程序', 'name' => '微信小程序',
'auth' => 'openid1', 'auth' => 'openid1',
], ],
UserService::APITYPE_WECHAT => [ UserService::API_TYPE_WECHAT => [
'name' => '微信服务号', 'name' => '微信服务号',
'auth' => 'openid2', 'auth' => 'openid2',
], ],
UserService::API_TYPE_IOSAPP => [
'name' => '苹果APP应用',
'auth' => 'phone',
],
UserService::API_TYPE_ANDROID => [
'name' => '安卓APP应用',
'auth' => 'phone',
],
]; ];
/** /**

View File

@ -48,6 +48,9 @@
// 背景图片切换 // 背景图片切换
$('[data-upload-image]').uploadFile(function (url) { $('[data-upload-image]').uploadFile(function (url) {
image.src = url; image.src = url;
console.log(cropper)
// cropper.refresh();
// cropper.resize();
cropper.replace(url, true).reset(); cropper.replace(url, true).reset();
}); });
// 保存设置参数 // 保存设置参数

View File

@ -25,8 +25,8 @@
<fieldset class="block"> <fieldset class="block">
<legend><span class="layui-badge">团队结算</span></legend> <legend><span class="layui-badge">团队结算</span></legend>
<div class="layui-form-item"> <div class="layui-form-item">
{php}$data['teams_type'] = $data['teams_type'] ?? 1;{/php} {php} $data['teams_type'] = $data['teams_type'] ?? 1; {/php}
{foreach [1 => '实时结算',2 => '次月结算'] as $key=>$val}{if $data.teams_type eq $key} {foreach [1 => '实时结算', 2 => '次月结算'] as $key=>$val}{if $data.teams_type eq $key}
<input checked class="layui-input" type="radio" name="teams_type" value="{$key}" title="{$val}"> <input checked class="layui-input" type="radio" name="teams_type" value="{$key}" title="{$val}">
{else} {else}
<input class="layui-input" type="radio" name="teams_type" value="{$key}" title="{$val}"> <input class="layui-input" type="radio" name="teams_type" value="{$key}" title="{$val}">