新增各端默认支付方式、虚拟订单快速提交订单
parent
24792b4baf
commit
93805af36e
|
|
@ -14,6 +14,7 @@ use app\service\SystemService;
|
||||||
use app\service\ConfigService;
|
use app\service\ConfigService;
|
||||||
use app\service\GoodsService;
|
use app\service\GoodsService;
|
||||||
use app\service\SiteService;
|
use app\service\SiteService;
|
||||||
|
use app\service\PaymentService;
|
||||||
use app\service\ResourcesService;
|
use app\service\ResourcesService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -129,6 +130,13 @@ class Site extends Common
|
||||||
$ret = SiteService::FloorManualModeGoodsViewHandle(json_decode($data['home_index_floor_manual_mode_goods']['value'], true));
|
$ret = SiteService::FloorManualModeGoodsViewHandle(json_decode($data['home_index_floor_manual_mode_goods']['value'], true));
|
||||||
MyViewAssign('floor_manual_mode_goods_list', $ret['data']);
|
MyViewAssign('floor_manual_mode_goods_list', $ret['data']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 支付方式
|
||||||
|
$payment_list = PaymentService::PaymentList(['is_enable'=>1, 'is_open_user'=>1]);
|
||||||
|
MyViewAssign('payment_list', $payment_list);
|
||||||
|
|
||||||
|
// 默认支付方式
|
||||||
|
//$params['common_default_payment'] = empty($params['common_default_payment']) ? '' : json_encode($params['common_default_payment'], JSON_UNESCAPED_UNICODE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -157,6 +165,9 @@ class Site extends Common
|
||||||
// 时区
|
// 时区
|
||||||
MyViewAssign('site_timezone_list', MyConst('site_timezone_list'));
|
MyViewAssign('site_timezone_list', MyConst('site_timezone_list'));
|
||||||
|
|
||||||
|
// 平台
|
||||||
|
MyViewAssign('common_platform_type', MyConst('common_platform_type'));
|
||||||
|
|
||||||
// 关闭开启
|
// 关闭开启
|
||||||
MyViewAssign('common_close_open_list', MyConst('common_close_open_list'));
|
MyViewAssign('common_close_open_list', MyConst('common_close_open_list'));
|
||||||
|
|
||||||
|
|
@ -354,6 +365,11 @@ class Site extends Common
|
||||||
case 'search' :
|
case 'search' :
|
||||||
$field_list[] = 'home_search_params_type';
|
$field_list[] = 'home_search_params_type';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// 订单
|
||||||
|
case 'order' :
|
||||||
|
$params['common_default_payment'] = empty($params['common_default_payment']) ? '' : json_encode($params['common_default_payment'], JSON_UNESCAPED_UNICODE);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,70 +13,117 @@
|
||||||
|
|
||||||
<!-- form start -->
|
<!-- form start -->
|
||||||
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/site/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/site/index', ['nav_type'=>$nav_type, 'view_type'=>$view_type])}}" enctype="multipart/form-data">
|
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/site/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/site/index', ['nav_type'=>$nav_type, 'view_type'=>$view_type])}}" enctype="multipart/form-data">
|
||||||
<!-- 是否预约模式 -->
|
<!-- 基础 -->
|
||||||
<div class="am-form-group">
|
<div class="am-panel am-panel-default am-margin-top-sm">
|
||||||
<label>{{$data.common_order_is_booking.name}}<span class="am-form-group-label-tips">{{$data.common_order_is_booking.describe}}</span></label>
|
<div class="am-panel-hd">
|
||||||
<select name="{{$data.common_order_is_booking.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_order_is_booking.error_tips}}" required>
|
<h3 class="am-panel-title">基础</h3>
|
||||||
{{foreach $common_is_text_list as $v}}
|
</div>
|
||||||
<option value="{{$v.id}}" {{if isset($data['common_order_is_booking']['value']) and $data['common_order_is_booking']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
<div class="am-panel-bd am-padding-vertical-xs">
|
||||||
{{/foreach}}
|
<!-- 是否预约模式 -->
|
||||||
</select>
|
<div class="am-form-group">
|
||||||
|
<label>{{$data.common_order_is_booking.name}}<span class="am-form-group-label-tips">{{$data.common_order_is_booking.describe}}</span></label>
|
||||||
|
<select name="{{$data.common_order_is_booking.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_order_is_booking.error_tips}}" required>
|
||||||
|
{{foreach $common_is_text_list as $v}}
|
||||||
|
<option value="{{$v.id}}" {{if isset($data['common_order_is_booking']['value']) and $data['common_order_is_booking']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
||||||
|
{{/foreach}}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 库存 -->
|
||||||
|
<div class="am-form-group">
|
||||||
|
<label>{{$data.common_is_deduction_inventory.name}}<span class="am-form-group-label-tips">{{$data.common_is_deduction_inventory.describe}}</span></label>
|
||||||
|
<select name="{{$data.common_is_deduction_inventory.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_is_deduction_inventory.error_tips}}" required>
|
||||||
|
{{foreach $common_is_text_list as $v}}
|
||||||
|
<option value="{{$v.id}}" {{if isset($data['common_is_deduction_inventory']['value']) and $data['common_is_deduction_inventory']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
||||||
|
{{/foreach}}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="am-form-group">
|
||||||
|
<label>{{$data.common_deduction_inventory_rules.name}}<span class="am-form-group-label-tips">{{$data.common_deduction_inventory_rules.describe}}</span></label>
|
||||||
|
<select name="{{$data.common_deduction_inventory_rules.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_deduction_inventory_rules.error_tips}}" required>
|
||||||
|
{{foreach $common_deduction_inventory_rules_list as $v}}
|
||||||
|
<option value="{{$v.id}}" {{if isset($data['common_deduction_inventory_rules']['value']) and $data['common_deduction_inventory_rules']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
||||||
|
{{/foreach}}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 订单商品销量 -->
|
||||||
|
<div class="am-form-group">
|
||||||
|
<label>{{$data.common_goods_sales_count_inc_rules.name}}<span class="am-form-group-label-tips">{{$data.common_goods_sales_count_inc_rules.describe}}</span></label>
|
||||||
|
<select name="{{$data.common_goods_sales_count_inc_rules.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_goods_sales_count_inc_rules.error_tips}}" required>
|
||||||
|
{{foreach $common_sales_count_inc_rules_list as $v}}
|
||||||
|
<option value="{{$v.id}}" {{if isset($data['common_goods_sales_count_inc_rules']['value']) and $data['common_goods_sales_count_inc_rules']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
||||||
|
{{/foreach}}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 订单支付 -->
|
||||||
|
<div class="am-form-group">
|
||||||
|
<label>{{$data.home_is_enable_order_bulk_pay.name}}<span class="am-form-group-label-tips">{{$data.home_is_enable_order_bulk_pay.describe}}</span></label>
|
||||||
|
<select name="{{$data.home_is_enable_order_bulk_pay.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.home_is_enable_order_bulk_pay.error_tips}}" required>
|
||||||
|
{{foreach $common_is_text_list as $v}}
|
||||||
|
<option value="{{$v.id}}" {{if isset($data['home_is_enable_order_bulk_pay']['value']) and $data['home_is_enable_order_bulk_pay']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
||||||
|
{{/foreach}}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="am-form-group">
|
||||||
|
<label>{{$data.common_is_pay_price_must_max_equal.name}}<span class="am-form-group-label-tips">{{$data.common_is_pay_price_must_max_equal.describe}}</span></label>
|
||||||
|
<select name="{{$data.common_is_pay_price_must_max_equal.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_is_pay_price_must_max_equal.error_tips}}" required>
|
||||||
|
{{foreach $common_close_open_list as $v}}
|
||||||
|
<option value="{{$v.value}}" {{if isset($data['common_is_pay_price_must_max_equal']['value']) and $data['common_is_pay_price_must_max_equal']['value'] eq $v['value']}}selected{{/if}}>{{$v.name}}</option>
|
||||||
|
{{/foreach}}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 线下支付 -->
|
||||||
|
<div class="am-form-group">
|
||||||
|
<label>{{$data.common_is_under_line_order_normal.name}}<span class="am-form-group-label-tips">{{$data.common_is_under_line_order_normal.describe}}</span></label>
|
||||||
|
<select name="{{$data.common_is_under_line_order_normal.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_is_under_line_order_normal.error_tips}}" required>
|
||||||
|
{{foreach $common_is_text_list as $v}}
|
||||||
|
<option value="{{$v.id}}" {{if isset($data['common_is_under_line_order_normal']['value']) and $data['common_is_under_line_order_normal']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
||||||
|
{{/foreach}}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 虚拟订单直接提交支付 -->
|
||||||
|
<div class="am-form-group">
|
||||||
|
<label>{{$data.common_fictitious_order_direct_pay.name}}<span class="am-form-group-label-tips">{{$data.common_fictitious_order_direct_pay.describe}}</span></label>
|
||||||
|
<select name="{{$data.common_fictitious_order_direct_pay.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_fictitious_order_direct_pay.error_tips}}" required>
|
||||||
|
{{foreach $common_is_text_list as $v}}
|
||||||
|
<option value="{{$v.id}}" {{if isset($data['common_fictitious_order_direct_pay']['value']) and $data['common_fictitious_order_direct_pay']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
||||||
|
{{/foreach}}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 库存 -->
|
<!-- 默认支付方式 -->
|
||||||
<div class="am-form-group">
|
<div class="am-panel am-panel-default am-margin-top-sm">
|
||||||
<label>{{$data.common_is_deduction_inventory.name}}<span class="am-form-group-label-tips">{{$data.common_is_deduction_inventory.describe}}</span></label>
|
<div class="am-panel-hd">
|
||||||
<select name="{{$data.common_is_deduction_inventory.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_is_deduction_inventory.error_tips}}" required>
|
<h3 class="am-panel-title">默认支付方式</h3>
|
||||||
{{foreach $common_is_text_list as $v}}
|
</div>
|
||||||
<option value="{{$v.id}}" {{if isset($data['common_is_deduction_inventory']['value']) and $data['common_is_deduction_inventory']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
<div class="am-panel-bd">
|
||||||
{{/foreach}}
|
<div class="business-form-group am-padding-vertical-0 platform-list-value-container">
|
||||||
</select>
|
<p class="am-text-warning">可以设置不同平台对应的默认支付方式、请先在[ 网站管理 -> 支付方式 ]中安装好支付插件启用并对用户开放</p>
|
||||||
</div>
|
{{foreach $common_platform_type as $v}}
|
||||||
<div class="am-form-group">
|
<div class="am-input-group am-input-group-sm">
|
||||||
<label>{{$data.common_deduction_inventory_rules.name}}<span class="am-form-group-label-tips">{{$data.common_deduction_inventory_rules.describe}}</span></label>
|
<span class="am-input-group-btn">
|
||||||
<select name="{{$data.common_deduction_inventory_rules.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_deduction_inventory_rules.error_tips}}" required>
|
<button type="button" class="am-btn am-btn-default am-radius">{{$v.name}}</button>
|
||||||
{{foreach $common_deduction_inventory_rules_list as $v}}
|
</span>
|
||||||
<option value="{{$v.id}}" {{if isset($data['common_deduction_inventory_rules']['value']) and $data['common_deduction_inventory_rules']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
<select name="common_default_payment[{{$v.value}}]" class="am-radius chosen-select" data-placeholder="可选择..." data-validation-message="请选择{{$v.name}}默认支付方式">
|
||||||
{{/foreach}}
|
<option value="">可选择...</option>
|
||||||
</select>
|
{{if !empty($payment_list)}}
|
||||||
</div>
|
{{foreach $payment_list as $pay}}
|
||||||
|
{{if !empty($pay['apply_terminal']) and is_array($pay['apply_terminal']) and in_array($v['value'], $pay['apply_terminal'])}}
|
||||||
<!-- 订单商品销量 -->
|
<option value="{{$pay.payment}}" {{if !empty($data['common_default_payment']) and !empty($data['common_default_payment']['value']) and !empty($data['common_default_payment']['value'][$v['value']]) and $data['common_default_payment']['value'][$v['value']] eq $pay['payment']}}selected{{/if}}>{{$pay.name}}</option>
|
||||||
<div class="am-form-group">
|
{{/if}}
|
||||||
<label>{{$data.common_goods_sales_count_inc_rules.name}}<span class="am-form-group-label-tips">{{$data.common_goods_sales_count_inc_rules.describe}}</span></label>
|
{{/foreach}}
|
||||||
<select name="{{$data.common_goods_sales_count_inc_rules.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_goods_sales_count_inc_rules.error_tips}}" required>
|
{{/if}}
|
||||||
{{foreach $common_sales_count_inc_rules_list as $v}}
|
</select>
|
||||||
<option value="{{$v.id}}" {{if isset($data['common_goods_sales_count_inc_rules']['value']) and $data['common_goods_sales_count_inc_rules']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
</div>
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
</select>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 订单支付 -->
|
|
||||||
<div class="am-form-group">
|
|
||||||
<label>{{$data.home_is_enable_order_bulk_pay.name}}<span class="am-form-group-label-tips">{{$data.home_is_enable_order_bulk_pay.describe}}</span></label>
|
|
||||||
<select name="{{$data.home_is_enable_order_bulk_pay.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.home_is_enable_order_bulk_pay.error_tips}}" required>
|
|
||||||
{{foreach $common_is_text_list as $v}}
|
|
||||||
<option value="{{$v.id}}" {{if isset($data['home_is_enable_order_bulk_pay']['value']) and $data['home_is_enable_order_bulk_pay']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
|
||||||
{{/foreach}}
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="am-form-group">
|
|
||||||
<label>{{$data.common_is_pay_price_must_max_equal.name}}<span class="am-form-group-label-tips">{{$data.common_is_pay_price_must_max_equal.describe}}</span></label>
|
|
||||||
<select name="{{$data.common_is_pay_price_must_max_equal.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_is_pay_price_must_max_equal.error_tips}}" required>
|
|
||||||
{{foreach $common_close_open_list as $v}}
|
|
||||||
<option value="{{$v.value}}" {{if isset($data['common_is_pay_price_must_max_equal']['value']) and $data['common_is_pay_price_must_max_equal']['value'] eq $v['value']}}selected{{/if}}>{{$v.name}}</option>
|
|
||||||
{{/foreach}}
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 线下支付 -->
|
|
||||||
<div class="am-form-group">
|
|
||||||
<label>{{$data.common_is_under_line_order_normal.name}}<span class="am-form-group-label-tips">{{$data.common_is_under_line_order_normal.describe}}</span></label>
|
|
||||||
<select name="{{$data.common_is_under_line_order_normal.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_is_under_line_order_normal.error_tips}}" required>
|
|
||||||
{{foreach $common_is_text_list as $v}}
|
|
||||||
<option value="{{$v.id}}" {{if isset($data['common_is_under_line_order_normal']['value']) and $data['common_is_under_line_order_normal']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
|
||||||
{{/foreach}}
|
|
||||||
</select>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="am-form-group am-form-group-refreshing am-margin-top-lg am-padding-left-0">
|
<div class="am-form-group am-form-group-refreshing am-margin-top-lg am-padding-left-0">
|
||||||
|
|
|
||||||
|
|
@ -54,11 +54,20 @@ class Buy extends Common
|
||||||
// 获取商品列表
|
// 获取商品列表
|
||||||
$params = $this->data_post;
|
$params = $this->data_post;
|
||||||
$params['user'] = $this->user;
|
$params['user'] = $this->user;
|
||||||
$ret = BuyService::BuyTypeGoodsList($params);
|
|
||||||
|
|
||||||
// 商品校验
|
// 默认支付方式
|
||||||
|
$params['payment_id'] = PaymentService::BuyDefaultPayment($params);
|
||||||
|
|
||||||
|
// 订单初始化
|
||||||
|
$ret = BuyService::BuyOrderInit($params);
|
||||||
if(isset($ret['code']) && $ret['code'] == 0)
|
if(isset($ret['code']) && $ret['code'] == 0)
|
||||||
{
|
{
|
||||||
|
// 订单是否已提交、则直接进入订单支付
|
||||||
|
if(isset($ret['data']['is_order_submit']) && $ret['data']['is_order_submit'] == 1)
|
||||||
|
{
|
||||||
|
return ApiService::ApiDataReturn($ret);
|
||||||
|
}
|
||||||
|
|
||||||
// 基础信息
|
// 基础信息
|
||||||
$buy_base = $ret['data']['base'];
|
$buy_base = $ret['data']['base'];
|
||||||
$buy_goods = $ret['data']['goods'];
|
$buy_goods = $ret['data']['goods'];
|
||||||
|
|
|
||||||
|
|
@ -81,11 +81,20 @@ class Buy extends Common
|
||||||
// 参数
|
// 参数
|
||||||
$params = array_merge($this->data_request, $data);
|
$params = array_merge($this->data_request, $data);
|
||||||
$params['user'] = $this->user;
|
$params['user'] = $this->user;
|
||||||
$ret = BuyService::BuyTypeGoodsList($params);
|
|
||||||
|
|
||||||
// 商品校验
|
// 默认支付方式
|
||||||
|
$params['payment_id'] = PaymentService::BuyDefaultPayment($params);
|
||||||
|
|
||||||
|
// 订单初始化
|
||||||
|
$ret = BuyService::BuyOrderInit($params);
|
||||||
if(isset($ret['code']) && $ret['code'] == 0)
|
if(isset($ret['code']) && $ret['code'] == 0)
|
||||||
{
|
{
|
||||||
|
// 订单是否已提交、则直接进入订单支付
|
||||||
|
if(isset($ret['data']['is_order_submit']) && $ret['data']['is_order_submit'] == 1)
|
||||||
|
{
|
||||||
|
return MyRedirect($ret['data']['jump_url']);
|
||||||
|
}
|
||||||
|
|
||||||
// 基础信息
|
// 基础信息
|
||||||
$buy_base = $ret['data']['base'];
|
$buy_base = $ret['data']['base'];
|
||||||
$buy_goods = $ret['data']['goods'];
|
$buy_goods = $ret['data']['goods'];
|
||||||
|
|
|
||||||
|
|
@ -1131,6 +1131,7 @@ class BuyService
|
||||||
$order_status = 2;
|
$order_status = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$payment_id = intval($payment_id);
|
||||||
|
|
||||||
// 循环处理数据
|
// 循环处理数据
|
||||||
$order_data = [];
|
$order_data = [];
|
||||||
|
|
@ -1226,6 +1227,7 @@ class BuyService
|
||||||
$result = [
|
$result = [
|
||||||
'order_status' => $order_status,
|
'order_status' => $order_status,
|
||||||
'order_ids' => $order_ids,
|
'order_ids' => $order_ids,
|
||||||
|
'payment_id' => $payment_id,
|
||||||
'jump_url' => MyUrl('index/order/index'),
|
'jump_url' => MyUrl('index/order/index'),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -2226,5 +2228,35 @@ class BuyService
|
||||||
|
|
||||||
return DataReturn('操作成功', 0, $result);
|
return DataReturn('操作成功', 0, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 购买订单初始化
|
||||||
|
* @author Devil
|
||||||
|
* @blog http://gong.gg/
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2022-07-31
|
||||||
|
* @desc description
|
||||||
|
* @param [array] $params [输入参数]
|
||||||
|
*/
|
||||||
|
public static function BuyOrderInit($params = [])
|
||||||
|
{
|
||||||
|
// 商品数据
|
||||||
|
$ret = self::BuyTypeGoodsList($params);
|
||||||
|
if(isset($ret['code']) && $ret['code'] == 0 && !empty($ret['data']))
|
||||||
|
{
|
||||||
|
// 是否开启虚拟订单快速创建订单
|
||||||
|
if($ret['data']['base']['site_model'] == 3 && MyC('common_fictitious_order_direct_pay') == 1)
|
||||||
|
{
|
||||||
|
// 调用订单添加
|
||||||
|
$ret = self::OrderInsert($params);
|
||||||
|
if($ret['code'] == 0)
|
||||||
|
{
|
||||||
|
// 标记订单已提交
|
||||||
|
$ret['data']['is_order_submit'] = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
@ -47,6 +47,7 @@ class ConfigService
|
||||||
'home_email_login_template',
|
'home_email_login_template',
|
||||||
'home_site_security_record_url',
|
'home_site_security_record_url',
|
||||||
'home_site_company_license',
|
'home_site_company_license',
|
||||||
|
'common_default_payment',
|
||||||
];
|
];
|
||||||
|
|
||||||
// 附件字段列表
|
// 附件字段列表
|
||||||
|
|
@ -75,6 +76,11 @@ class ConfigService
|
||||||
'common_user_address_platform_import_list',
|
'common_user_address_platform_import_list',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// json数组字段
|
||||||
|
public static $data_json_array_field_list = [
|
||||||
|
'common_default_payment',
|
||||||
|
];
|
||||||
|
|
||||||
// 需要文件缓存的key
|
// 需要文件缓存的key
|
||||||
public static $file_cache_keys = [
|
public static $file_cache_keys = [
|
||||||
// 伪静态后缀
|
// 伪静态后缀
|
||||||
|
|
@ -103,6 +109,9 @@ class ConfigService
|
||||||
'common_cdn_attachment_host',
|
'common_cdn_attachment_host',
|
||||||
'common_cdn_public_host',
|
'common_cdn_public_host',
|
||||||
|
|
||||||
|
// h5地址
|
||||||
|
'common_app_h5_url',
|
||||||
|
|
||||||
// 编辑器配置信息
|
// 编辑器配置信息
|
||||||
'home_max_limit_image',
|
'home_max_limit_image',
|
||||||
'home_max_limit_video',
|
'home_max_limit_video',
|
||||||
|
|
@ -140,6 +149,15 @@ class ConfigService
|
||||||
$v['value'] = (!isset($v['value']) || $v['value'] == '' || is_array($v['value'])) ? [] : explode(',', $v['value']);
|
$v['value'] = (!isset($v['value']) || $v['value'] == '' || is_array($v['value'])) ? [] : explode(',', $v['value']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// json数据数组
|
||||||
|
foreach(self::$data_json_array_field_list as $fv)
|
||||||
|
{
|
||||||
|
if($k == $fv)
|
||||||
|
{
|
||||||
|
$v['value'] = empty($v['value']) ? [] : json_decode($v['value'], true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $data;
|
return $data;
|
||||||
|
|
@ -247,6 +265,15 @@ class ConfigService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// json数据数组
|
||||||
|
foreach(self::$data_json_array_field_list as $fv)
|
||||||
|
{
|
||||||
|
if(isset($data[$fv]))
|
||||||
|
{
|
||||||
|
$data[$fv] = empty($data[$fv]) ? [] : json_decode($data[$fv], true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 数据处理
|
// 数据处理
|
||||||
foreach($data as $k=>&$v)
|
foreach($data as $k=>&$v)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1165,5 +1165,34 @@ php;
|
||||||
|
|
||||||
return DataReturn('无插件数据', 0);
|
return DataReturn('无插件数据', 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 购买默认支付方式
|
||||||
|
* @author Devil
|
||||||
|
* @blog http://gong.gg/
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2022-07-31
|
||||||
|
* @desc description
|
||||||
|
* @param [array] $params [输入参数]
|
||||||
|
*/
|
||||||
|
public static function BuyDefaultPayment($params = [])
|
||||||
|
{
|
||||||
|
if(empty($params['payment_id']))
|
||||||
|
{
|
||||||
|
$payment_id = 0;
|
||||||
|
$default_payment = MyC('common_default_payment');
|
||||||
|
if(!empty($default_payment) && !empty($default_payment[APPLICATION_CLIENT_TYPE]))
|
||||||
|
{
|
||||||
|
$where = [
|
||||||
|
['payment', '=', $default_payment[APPLICATION_CLIENT_TYPE]],
|
||||||
|
['is_enable', '=', 1],
|
||||||
|
['is_open_user', '=', 1],
|
||||||
|
];
|
||||||
|
$payment_id = Db::name('Payment')->where($where)->value('id');
|
||||||
|
}
|
||||||
|
$params['payment_id'] = empty($payment_id) ? 0 : $payment_id;
|
||||||
|
}
|
||||||
|
return $params['payment_id'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
@ -935,4 +935,14 @@ form .am-tab-panel .am-form-group:last-child {
|
||||||
.warehouse-item-container .warehouse-icon {
|
.warehouse-item-container .warehouse-icon {
|
||||||
width: 14px;
|
width: 14px;
|
||||||
height: 14px;
|
height: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平台类型+数据值组合列表
|
||||||
|
*/
|
||||||
|
.platform-list-value-container > div.am-input-group:not(:first-child) {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
.platform-list-value-container > div.am-input-group button {
|
||||||
|
width: 110px;
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue