mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2025-12-11 18:32:49 +00:00
update niucloud
This commit is contained in:
parent
2f59c7d5f0
commit
ffa375f219
@ -205,17 +205,4 @@ class Diy extends BaseAdminController
|
||||
return success(( new DiyService() )->changeTemplate($data));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取页面预览数据
|
||||
*/
|
||||
public function getPreviewData()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ "id", "" ],
|
||||
[ 'name', '' ]
|
||||
]);
|
||||
$res = ( new DiyService() )->getPreviewData($data);
|
||||
return success($res);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
65
niucloud/app/adminapi/controller/pay/PayRefund.php
Normal file
65
niucloud/app/adminapi/controller/pay/PayRefund.php
Normal file
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\pay;
|
||||
|
||||
use app\dict\pay\RefundDict;
|
||||
use app\service\admin\pay\RefundService;
|
||||
use core\base\BaseAdminController;
|
||||
|
||||
class PayRefund extends BaseAdminController
|
||||
{
|
||||
/**
|
||||
* 退款列表
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function pages()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
['refund_no', ''],
|
||||
['create_time', []],
|
||||
['status', '']
|
||||
]);
|
||||
return success(data: (new RefundService())->getPage($data));
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款详情
|
||||
* @param $refund_no
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function detail($refund_no)
|
||||
{
|
||||
return success(data: (new RefundService())->getDetail($refund_no));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取退款方式
|
||||
*/
|
||||
public function getRefundType()
|
||||
{
|
||||
return success(data:(new RefundDict())->getType());
|
||||
}
|
||||
|
||||
/**
|
||||
* 转账
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function transfer()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
['refund_no', ''],
|
||||
['refund_type', []],
|
||||
['voucher', '']
|
||||
]);
|
||||
return success(data:(new RefundService())->refund($data));
|
||||
}
|
||||
}
|
||||
@ -99,4 +99,13 @@ class System extends BaseAdminController
|
||||
$key = input('key', '');
|
||||
return success(data: ( new SystemService() )->setLayout($key));
|
||||
}
|
||||
|
||||
/**
|
||||
* 环境变量查询
|
||||
* @return Response
|
||||
*/
|
||||
public function getEnvInfo()
|
||||
{
|
||||
return success(['app_debug' => env('app_debug', false)]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ use think\facade\Route;
|
||||
/**
|
||||
* 路由
|
||||
*/
|
||||
Route::group('auth', function () {
|
||||
Route::group('auth', function() {
|
||||
/***************************************************** 授权信息 ****************************************************/
|
||||
Route::put('logout', 'login.Login/logout');
|
||||
/***************************************************** 授权信息 ****************************************************/
|
||||
|
||||
@ -68,9 +68,6 @@ Route::group('diy', function() {
|
||||
// 编辑自定义页面分享内容
|
||||
Route::put('diy/share', 'diy.Diy/modifyShare');
|
||||
|
||||
// 获取页面预览数据
|
||||
Route::put('preview', 'diy.Diy/getPreviewData');
|
||||
|
||||
/***************************************************** 配置相关 *****************************************************/
|
||||
|
||||
// 底部导航查询
|
||||
|
||||
@ -48,6 +48,15 @@ Route::group('pay', function () {
|
||||
Route::get('account/stat', 'pay.Account/stat');
|
||||
//账单类型
|
||||
Route::get('account/type', 'pay.Account/accountType');
|
||||
/***************************************************** 退款 *************************************************/
|
||||
//退款列表
|
||||
Route::get('refund', 'pay.PayRefund/pages');
|
||||
//退款详情
|
||||
Route::get('refund/:refund_no', 'pay.PayRefund/detail');
|
||||
//退款方式
|
||||
Route::get('refund/type', 'pay.PayRefund/getRefundType');
|
||||
//退款转账
|
||||
Route::post('refund/transfer', 'pay.PayRefund/transfer');
|
||||
})->middleware([
|
||||
AdminCheckToken::class,
|
||||
AdminCheckRole::class,
|
||||
|
||||
@ -158,8 +158,8 @@ Route::group('sys', function () {
|
||||
Route::get('job', 'sys.System/checkJob');
|
||||
//校验计划任务
|
||||
Route::get('schedule', 'sys.System/checkSchedule');
|
||||
|
||||
|
||||
//环境变量
|
||||
Route::get('env', 'sys.System/getEnvInfo');
|
||||
/***************************************************** 计划任务 ****************************************************/
|
||||
//计划任务列表
|
||||
Route::get('schedule/list', 'sys.Schedule/lists');
|
||||
|
||||
@ -54,6 +54,7 @@ class Address extends BaseApiController
|
||||
["city_id",0],
|
||||
["district_id",0],
|
||||
["address",""],
|
||||
["address_name", ""],
|
||||
["full_address",""],
|
||||
["lng",""],
|
||||
["lat",""],
|
||||
@ -78,6 +79,7 @@ class Address extends BaseApiController
|
||||
["city_id",0],
|
||||
["district_id",0],
|
||||
["address",""],
|
||||
["address_name", ""],
|
||||
["full_address",""],
|
||||
["lng",""],
|
||||
["lat",""],
|
||||
|
||||
@ -256,24 +256,13 @@ class ComponentDict
|
||||
'list' => []
|
||||
],
|
||||
],
|
||||
'GoodsList' => [
|
||||
'title' => '商品列表',
|
||||
'icon' => 'iconfont-iconshangpinliebiao',
|
||||
'path' => 'edit-goods-list',
|
||||
'support_page' => [],
|
||||
'uses' => 0,
|
||||
'sort' => 10009,
|
||||
'value' => [
|
||||
'list' => []
|
||||
],
|
||||
],
|
||||
'Notice' => [
|
||||
'title' => '公告',
|
||||
'icon' => 'iconfont-icongonggao',
|
||||
'path' => 'edit-notice',
|
||||
'support_page' => [],
|
||||
'uses' => 0,
|
||||
'sort' => 10009,
|
||||
'sort' => 10010,
|
||||
'value' => [
|
||||
"list" => [
|
||||
"link" => [
|
||||
@ -284,7 +273,7 @@ class ComponentDict
|
||||
"iconType" => "system",
|
||||
"systemIcon" => "style_01",
|
||||
"showType" => "popup",
|
||||
"imageUrld" => ""
|
||||
"imageUrl" => ""
|
||||
],
|
||||
]
|
||||
],
|
||||
|
||||
@ -33,7 +33,7 @@ class LinkDict
|
||||
'title' => get_lang('dict_diy.system_link_index'),
|
||||
'url' => '/app/pages/index/index',
|
||||
'is_share' => 1,
|
||||
'action' => '' // 默认空,decorate 表示支持装修
|
||||
'action' => 'decorate' // 默认空,decorate 表示支持装修
|
||||
],
|
||||
]
|
||||
],
|
||||
@ -47,7 +47,7 @@ class LinkDict
|
||||
'title' => get_lang('dict_diy.member_index'),
|
||||
'url' => '/app/pages/member/index',
|
||||
'is_share' => 1,
|
||||
'action' => ''
|
||||
'action' => 'decorate'
|
||||
],
|
||||
[
|
||||
'name' => 'MEMBER_PERSONAL',
|
||||
@ -76,6 +76,13 @@ class LinkDict
|
||||
'url' => '/app/pages/member/commission',
|
||||
'is_share' => 1,
|
||||
'action' => ''
|
||||
],
|
||||
[
|
||||
'name' => 'MEMBER_ADDRESS',
|
||||
'title' => get_lang('dict_diy.member_my_address'),
|
||||
'url' => '/app/pages/member/address',
|
||||
'is_share' => 1,
|
||||
'action' => ''
|
||||
]
|
||||
]
|
||||
],
|
||||
|
||||
@ -223,8 +223,12 @@ class PagesDict
|
||||
"bottom" => 6,
|
||||
"both" => 16
|
||||
],
|
||||
"style" => "style-1",
|
||||
"styleName" => "风格1",
|
||||
"textColor" => "#FFFFFF",
|
||||
"bgUrl" => "static/resource/images/diy/member_style1_bg.png"
|
||||
"bgUrl" => "static/resource/images/diy/member_style1_bg.png",
|
||||
"bgColorStart" => "",
|
||||
"bgColorEnd" => ""
|
||||
],
|
||||
[
|
||||
"path" => "edit-graphic-nav",
|
||||
@ -558,7 +562,11 @@ class PagesDict
|
||||
"both" => 0
|
||||
],
|
||||
"textColor" => "#FFFFFF",
|
||||
"bgUrl" => ""
|
||||
"bgUrl" => "",
|
||||
"style" => "style-1",
|
||||
"styleName" => "风格1",
|
||||
"bgColorStart" => "",
|
||||
"bgColorEnd" => ""
|
||||
],
|
||||
[
|
||||
"path" => "edit-graphic-nav",
|
||||
@ -822,18 +830,7 @@ class PagesDict
|
||||
|
||||
]
|
||||
]
|
||||
],
|
||||
// 'recharge' => [
|
||||
// "title" => "旅游", // 页面名称
|
||||
// 'cover' => 'static/resource/images/diy/template/tourism_member_index_cover.png', // 页面封面图
|
||||
// 'preview' => '', // 页面预览图
|
||||
// 'desc' => '酒店旅游住宿门票景点', // 页面描述
|
||||
// 'mode' => 'fixed', // 页面模式:diy:自定义,fixed:固定
|
||||
// 'data' => [
|
||||
// 'component' => 'recharge-member', // 模板组件名称
|
||||
// 'link' => '' // 装修链接
|
||||
// ]
|
||||
// ]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
@ -26,17 +26,17 @@ class TemplateDict
|
||||
$system_pages = [
|
||||
'DIY_INDEX' => [
|
||||
'title' => get_lang('dict_diy.page_index'),
|
||||
'page' => 'app/pages/index/index',
|
||||
'page' => '/app/pages/index/index',
|
||||
'action' => 'decorate' // 页面是否装修标识,为空标识不装修,decorate:装修
|
||||
],
|
||||
'DIY_MEMBER_INDEX' => [
|
||||
'title' => get_lang('dict_diy.page_member_index'),
|
||||
'page' => 'app/pages/member/index',
|
||||
'page' => '/app/pages/member/index',
|
||||
'action' => 'decorate'
|
||||
],
|
||||
'DIY_PAGE' => [
|
||||
'title' => get_lang('dict_diy.page_diy'),
|
||||
'page' => 'app/pages/index/diy',
|
||||
'page' => '/app/pages/index/diy',
|
||||
'action' => ''
|
||||
]
|
||||
];
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -19,7 +19,7 @@ class PayDict
|
||||
public const ALIPAY = 'alipay';//支付宝支付
|
||||
//const UNIPAY = 'unipay';//银联
|
||||
public const OFFLINEPAY = 'offlinepay';//线下支付
|
||||
public const BALANCEPAY = 'balancepay';//线下支付
|
||||
public const BALANCEPAY = 'balancepay';//余额支付
|
||||
|
||||
|
||||
public const ON = '1';
|
||||
@ -38,13 +38,14 @@ class PayDict
|
||||
//支付状态
|
||||
public const STATUS_WAIT = '0';//待支付
|
||||
public const STATUS_ING = '1';//支付中
|
||||
public const STATUS_ED = '2';//已支付
|
||||
public const STATUS_FINISH = '2';//已支付
|
||||
|
||||
public const STATUS_AUDIT = '3';//待审核
|
||||
public const STATUS_CALCLE = '-1';//已取消
|
||||
|
||||
//操作人类型
|
||||
public const MEMBER = 'member';
|
||||
public const USER = 'user';
|
||||
public const STORE = 'store';
|
||||
|
||||
/**
|
||||
* 支付类型
|
||||
@ -102,7 +103,7 @@ class PayDict
|
||||
return [
|
||||
self::STATUS_WAIT => get_lang('dict_pay.status_wait'),
|
||||
self::STATUS_ING => get_lang('dict_pay.status_ing'),
|
||||
self::STATUS_ED => get_lang('dict_pay.status_ed'),
|
||||
self::STATUS_FINISH => get_lang('dict_pay.status_finish'),
|
||||
self::STATUS_CALCLE => get_lang('dict_pay.status_cancle'),
|
||||
self::STATUS_AUDIT => get_lang('dict_pay.status_audit')
|
||||
];
|
||||
|
||||
@ -20,11 +20,11 @@ class RefundDict
|
||||
const FAIL = 'fail';//失败
|
||||
|
||||
// 退款方式
|
||||
const WECHATPAY = 'wechatpay';//微信支付
|
||||
const ALIPAY = 'alipay';//支付宝支付
|
||||
const WECHATPAY = 'wechatpay';//微信退款
|
||||
const ALIPAY = 'alipay';//支付宝退款
|
||||
const OFFLINE = 'offline';//线下打款
|
||||
const BALANCE = 'balance';//线下支付
|
||||
|
||||
const BALANCE = 'balance';//余额退款
|
||||
CONST BACK = 'back';//原路退款
|
||||
/**
|
||||
* 获取状态
|
||||
* @return array
|
||||
@ -32,10 +32,10 @@ class RefundDict
|
||||
public static function getStatus()
|
||||
{
|
||||
return [
|
||||
self::WAIT => get_lang('dict_pay_refund.status_wait'),
|
||||
self::DEALING => get_lang('dict_pay_refund.status_dealing'),
|
||||
self::SUCCESS => get_lang('dict_pay_refund.status_success'),
|
||||
self::FAIL => get_lang('dict_pay_refund.status_fail'),
|
||||
self::WAIT => get_lang('dict_pay_refund.wait'),
|
||||
self::DEALING => get_lang('dict_pay_refund.dealing'),
|
||||
self::SUCCESS => get_lang('dict_pay_refund.success'),
|
||||
self::FAIL => get_lang('dict_pay_refund.fail'),
|
||||
];
|
||||
}
|
||||
|
||||
@ -46,10 +46,11 @@ class RefundDict
|
||||
public static function getType()
|
||||
{
|
||||
return [
|
||||
self::WECHATPAY => get_lang('dict_pay_refund.wechatpay'),
|
||||
self::ALIPAY => get_lang('dict_pay_refund.alipay'),
|
||||
// self::WECHATPAY => get_lang('dict_pay_refund.wechatpay'),
|
||||
// self::ALIPAY => get_lang('dict_pay_refund.alipay'),
|
||||
self::OFFLINE => get_lang('dict_pay_refund.offline'),
|
||||
self::BALANCE => get_lang('dict_pay_refund.balance')
|
||||
// self::BALANCE => get_lang('dict_pay_refund.balance'),
|
||||
self::BACK => get_lang('dict_pay_refund.back'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@ -185,7 +185,7 @@ class Index extends BaseInstall
|
||||
public function getSqlQuery($sql_data)
|
||||
{
|
||||
$this->checkLock();
|
||||
$sql_data = preg_replace("/TYPE=(InnoDB|MyISAM|MEMORY)( DEFAULT CHARSET=[^; ]+)?/", "ENGINE=\\1 DEFAULT CHARSET=utf8", $sql_data);
|
||||
$sql_data = preg_replace("/TYPE=(InnoDB|MyISAM|MEMORY)( DEFAULT CHARSET=[^; ]+)?/", "ENGINE=\\1 DEFAULT CHARSET=utf8mb4", $sql_data);
|
||||
|
||||
$sql_data = str_replace("\r", "\n", $sql_data);
|
||||
$sql_query = [];
|
||||
@ -246,7 +246,7 @@ class Index extends BaseInstall
|
||||
$this->setSuccessLog([ $res[ 'msg' ], 'error' ]);
|
||||
return fail($res[ 'msg' ]);
|
||||
}
|
||||
//安装插件
|
||||
//安装插件 todo
|
||||
$this->installAddon();
|
||||
|
||||
Cache::set('install_status', 1);//成功
|
||||
@ -484,7 +484,7 @@ class Index extends BaseInstall
|
||||
|
||||
if (!empty($addon_files)) {
|
||||
foreach ($addon_files as $addon) {
|
||||
$service = (new coreAddonInstallService($addon));
|
||||
$service = (new CoreAddonInstallService($addon));
|
||||
$service->installCheck();
|
||||
$service->install();
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ CREATE TABLE `account_log` (
|
||||
`trade_no` varchar(255) NOT NULL DEFAULT '' COMMENT '对应类型交易单号',
|
||||
`create_time` varchar(255) NOT NULL DEFAULT '' COMMENT '添加时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='站点账单记录';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='站点账单记录';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `addon`;
|
||||
@ -30,7 +30,7 @@ CREATE TABLE `addon` (
|
||||
`compile` VARCHAR(2000) NOT NULL DEFAULT '' COMMENT '编译端口',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `UK_title` (`title`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='插件表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='插件表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `addon_log`;
|
||||
@ -42,7 +42,7 @@ CREATE TABLE `addon_log` (
|
||||
`to_version` varchar(20) NOT NULL DEFAULT '' COMMENT '升级后的版本号',
|
||||
`create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='插件日志表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='插件日志表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `diy_page`;
|
||||
@ -61,7 +61,7 @@ CREATE TABLE `diy_page` (
|
||||
`create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||
`update_time` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='自定义页面';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='自定义页面';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `diy_route`;
|
||||
@ -74,7 +74,7 @@ CREATE TABLE `diy_route` (
|
||||
`is_share` int(11) NOT NULL DEFAULT '0' COMMENT '是否支持分享',
|
||||
`sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='自定义路由';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='自定义路由';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `generate_column`;
|
||||
@ -100,7 +100,7 @@ CREATE TABLE `generate_column` (
|
||||
`create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||
`update_time` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='代码生成表字段信息表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='代码生成表字段信息表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `generate_table`;
|
||||
@ -118,7 +118,7 @@ CREATE TABLE `generate_table` (
|
||||
`relations` text DEFAULT NULL COMMENT '关联配置',
|
||||
`synchronous_number` int NOT NULL DEFAULT 0 COMMENT '同步次数',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='代码生成表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='代码生成表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `jobs`;
|
||||
@ -132,7 +132,7 @@ CREATE TABLE `jobs` (
|
||||
`create_time` int(11) unsigned DEFAULT '0',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `queue` (`queue`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='消息队列任务表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='消息队列任务表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `jobs_failed`;
|
||||
@ -144,7 +144,7 @@ CREATE TABLE `jobs_failed` (
|
||||
`exception` longtext NOT NULL,
|
||||
`fail_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='消息队列任务失败记录表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='消息队列任务失败记录表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `member`;
|
||||
@ -206,7 +206,7 @@ CREATE TABLE `member` (
|
||||
KEY `weapp_openid` (`weapp_openid`),
|
||||
KEY `wx_openid` (`wx_openid`),
|
||||
KEY `wx_unionid` (`wx_unionid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='会员表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='会员表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `member_account_log`;
|
||||
@ -225,7 +225,7 @@ CREATE TABLE `member_account_log` (
|
||||
KEY `create_time` (`create_time`),
|
||||
KEY `from_type` (`from_type`),
|
||||
KEY `member_id` (`member_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='会员账单表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='会员账单表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `member_address`;
|
||||
@ -238,6 +238,7 @@ CREATE TABLE `member_address` (
|
||||
`city_id` int(11) NOT NULL DEFAULT '0' COMMENT '市id',
|
||||
`district_id` int(11) NOT NULL DEFAULT '0' COMMENT '区县id',
|
||||
`address` varchar(255) NOT NULL DEFAULT '' COMMENT '地址信息',
|
||||
`address_name` VARCHAR(255) NOT NULL DEFAULT '',
|
||||
`full_address` varchar(255) NOT NULL DEFAULT '' COMMENT '详细地址信息',
|
||||
`lng` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '经度',
|
||||
`lat` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '纬度',
|
||||
@ -245,7 +246,7 @@ CREATE TABLE `member_address` (
|
||||
`type` VARCHAR(30) NOT NULL DEFAULT '' COMMENT '地址类型 address 普通地址 location_address 定位地址',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `IDX_member_address` (`member_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='会员收货地址';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='会员收货地址';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `member_cash_out`;
|
||||
@ -281,7 +282,7 @@ CREATE TABLE `member_cash_out` (
|
||||
KEY `member_withdraw_site_id` (`member_id`),
|
||||
KEY `member_withdraw_status` (`status`),
|
||||
KEY `member_withdraw_withdraw_no` (`cash_out_no`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='会员提现表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='会员提现表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `member_cash_out_account`;
|
||||
@ -295,7 +296,7 @@ CREATE TABLE `member_cash_out_account` (
|
||||
`update_time` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||
`account_no` varchar(255) NOT NULL DEFAULT '' COMMENT '提现账户',
|
||||
PRIMARY KEY (`account_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='会员提现账户';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='会员提现账户';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `member_collect`;
|
||||
@ -308,7 +309,7 @@ CREATE TABLE `member_collect` (
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `IDX_member_collect_goods` (`goods_id`),
|
||||
KEY `IDX_member_collect_member` (`member_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci;
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `member_label`;
|
||||
@ -322,7 +323,7 @@ CREATE TABLE `member_label` (
|
||||
PRIMARY KEY (`label_id`),
|
||||
KEY `label_id` (`label_id`),
|
||||
KEY `sort` (`sort`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='会员标签';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='会员标签';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `member_level`;
|
||||
@ -336,7 +337,7 @@ CREATE TABLE `member_level` (
|
||||
`update_time` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间',
|
||||
PRIMARY KEY (`level_id`),
|
||||
KEY `status` (`status`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='会员等级';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='会员等级';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `pay`;
|
||||
@ -362,7 +363,7 @@ CREATE TABLE `pay` (
|
||||
`fail_reason` varchar(255) NOT NULL DEFAULT '' COMMENT '失败原因',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `UK_ns_pay_out_trade_no` (`out_trade_no`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='支付记录表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='支付记录表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `pay_channel`;
|
||||
@ -376,7 +377,7 @@ CREATE TABLE `pay_channel` (
|
||||
`status` int(11) NOT NULL DEFAULT '0' COMMENT '是否启用',
|
||||
`sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='支付渠道配置表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='支付渠道配置表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `pay_refund`;
|
||||
@ -386,17 +387,22 @@ CREATE TABLE `pay_refund` (
|
||||
`out_trade_no` varchar(255) NOT NULL DEFAULT '' COMMENT '支付流水号',
|
||||
`type` varchar(255) NOT NULL DEFAULT '' COMMENT '支付方式',
|
||||
`channel` varchar(50) NOT NULL DEFAULT '' COMMENT '支付渠道',
|
||||
`money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '支付金额',
|
||||
`money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '退款金额',
|
||||
`reason` varchar(255) NOT NULL DEFAULT '' COMMENT '退款原因',
|
||||
`status` varchar(255) NOT NULL DEFAULT '0' COMMENT '支付状态(0.待退款 1. 退款中 2. 已退款 -1已关闭)',
|
||||
`create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||
`refund_time` int(11) NOT NULL DEFAULT '0' COMMENT '支付时间',
|
||||
`close_time` int(11) NOT NULL DEFAULT '0' COMMENT '关闭时间',
|
||||
`fail_reason` varchar(255) NOT NULL DEFAULT '' COMMENT '失败原因',
|
||||
`voucher` varchar(255) NOT NULL DEFAULT '' COMMENT '支付凭证',
|
||||
`voucher` varchar(255) NOT NULL DEFAULT '' COMMENT '退款凭证',
|
||||
`trade_type` VARCHAR(255) NOT NULL COMMENT '业务类型',
|
||||
`trade_id` VARCHAR(50) NOT NULL DEFAULT '' COMMENT '业务关联id',
|
||||
`refund_type` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '退款方式',
|
||||
`main_type` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '操作人类型',
|
||||
`main_id` INT(11) NOT NULL DEFAULT 0 COMMENT '操作人',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `UK_ns_pay_refund_refund_no` (`refund_no`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='支付记录表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='支付记录表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `pay_transfer`;
|
||||
@ -428,7 +434,7 @@ CREATE TABLE `pay_transfer` (
|
||||
KEY `member_withdraw_audit_time` (`transfer_time`),
|
||||
KEY `member_withdraw_site_id` (`main_id`),
|
||||
KEY `member_withdraw_status` (`transfer_status`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='转账表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='转账表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `sys_agreement`;
|
||||
@ -441,7 +447,7 @@ CREATE TABLE `sys_agreement` (
|
||||
`update_time` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `agreement_key` (`agreement_key`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='协议表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='协议表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `sys_area`;
|
||||
@ -4127,7 +4133,7 @@ CREATE TABLE `sys_attachment` (
|
||||
PRIMARY KEY (`att_id`),
|
||||
KEY `cate_id` (`cate_id`),
|
||||
KEY `create_time` (`create_time`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='附件管理表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='附件管理表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `sys_attachment_category`;
|
||||
@ -4142,7 +4148,7 @@ CREATE TABLE `sys_attachment_category` (
|
||||
UNIQUE KEY `id` (`id`),
|
||||
KEY `pid` (`pid`),
|
||||
KEY `sort` (`sort`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='附件分类表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='附件分类表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `sys_config`;
|
||||
@ -4155,7 +4161,7 @@ CREATE TABLE `sys_config` (
|
||||
`addon` varchar(255) NOT NULL DEFAULT '' COMMENT '所属插件',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `config_key` (`config_key`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统配置表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='系统配置表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `sys_dict`;
|
||||
@ -4168,7 +4174,7 @@ CREATE TABLE `sys_dict` (
|
||||
`create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||
`update_time` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='数据字典表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='数据字典表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `sys_menu`;
|
||||
@ -4196,7 +4202,7 @@ CREATE TABLE `sys_menu` (
|
||||
KEY `is_show` (`is_show`),
|
||||
KEY `menu_key` (`menu_key`),
|
||||
KEY `parent_key` (`parent_key`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='菜单表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='菜单表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `sys_notice`;
|
||||
@ -4215,7 +4221,7 @@ CREATE TABLE `sys_notice` (
|
||||
`wechat_remark` varchar(255) NOT NULL DEFAULT '' COMMENT '微信说明',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `message_key` (`key`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='通知模型';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='通知模型';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `sys_notice_log`;
|
||||
@ -4238,7 +4244,7 @@ CREATE TABLE `sys_notice_log` (
|
||||
KEY `member_id` (`member_id`),
|
||||
KEY `message_key` (`key`),
|
||||
KEY `uid` (`uid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='通知记录表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='通知记录表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `sys_notice_sms_log`;
|
||||
@ -4257,7 +4263,7 @@ CREATE TABLE `sys_notice_sms_log` (
|
||||
`update_time` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间',
|
||||
`delete_time` int(11) NOT NULL DEFAULT '0' COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='短信发送表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='短信发送表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `sys_role`;
|
||||
@ -4271,7 +4277,7 @@ CREATE TABLE `sys_role` (
|
||||
`update_time` int(11) NOT NULL DEFAULT '0' COMMENT '最后修改时间',
|
||||
PRIMARY KEY (`role_id`),
|
||||
KEY `status` (`status`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='角色表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `sys_schedule`;
|
||||
@ -4289,7 +4295,7 @@ CREATE TABLE `sys_schedule` (
|
||||
`update_time` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间',
|
||||
`sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统任务';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='系统任务';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `sys_user`;
|
||||
@ -4316,7 +4322,7 @@ CREATE TABLE `sys_user` (
|
||||
KEY `password` (`password`),
|
||||
KEY `update_time` (`update_time`),
|
||||
KEY `username` (`username`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='后台管理员表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='后台管理员表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `sys_user_log`;
|
||||
@ -4332,7 +4338,7 @@ CREATE TABLE `sys_user_log` (
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `create_time` (`create_time`),
|
||||
KEY `uid` (`uid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='管理员操作记录表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='管理员操作记录表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `weapp_version`;
|
||||
@ -4347,7 +4353,7 @@ CREATE TABLE `weapp_version` (
|
||||
`fail_reason` VARCHAR(2000) NOT NULL DEFAULT '',
|
||||
`task_key` varchar(20) NOT NULL DEFAULT '' COMMENT '上传任务key',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci;
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `wechat_fans`;
|
||||
@ -4374,7 +4380,7 @@ CREATE TABLE `wechat_fans` (
|
||||
PRIMARY KEY (`fans_id`),
|
||||
KEY `openid` (`openid`),
|
||||
KEY `unionid` (`unionid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='微信粉丝列表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='微信粉丝列表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `wechat_media`;
|
||||
@ -4387,7 +4393,7 @@ CREATE TABLE `wechat_media` (
|
||||
`media_id` varchar(70) NOT NULL DEFAULT '0' COMMENT '微信端返回的素材id',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `type` (`type`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='微信素材表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='微信素材表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `wechat_reply`;
|
||||
@ -4406,4 +4412,4 @@ CREATE TABLE `wechat_reply` (
|
||||
`delete_time` int(11) NOT NULL DEFAULT '0' COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `keyword` (`keyword`,`reply_type`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公众号消息回调表';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='公众号消息回调表';
|
||||
|
||||
@ -177,13 +177,14 @@ return [
|
||||
'SITE_CLOSE_NOT_ALLOW' => '站点已停止',
|
||||
|
||||
//支付相关(todo 注意:7段不共享)
|
||||
'ALIPAY_TRANSACTION_NO_NOT_EXIST' => '无效的支付交易号',
|
||||
'PAY_TRANSACTION_NO_NOT_EXIST' => '无效的支付交易号',
|
||||
'PAYMENT_METHOD_NOT_SUPPORT' => '您选择到支付方式不受业务支持',
|
||||
'PAYMENT_LOCK' => '支付中,请稍后再试',
|
||||
'PAY_SUCCESS' => '当前支付已完成',
|
||||
'PAY_IS_REMOVE' => '当前支付已取消',
|
||||
'PAY_NOT_FOUND_TRADE' => '找不到可支付的交易',
|
||||
'PAYMENT_METHOD_NOT_EXIST' => '你选择的支付方式未启用',
|
||||
'PAYMENT_METHOD_NOT_SCENE'=> '你选择的支付方式不适用于当前场景',
|
||||
'PAYMENT_METHOD_NOT_SCENE' => '你选择的支付方式不适用于当前场景',
|
||||
'TREAT_PAYMENT_IS_OPEN' => '只有待支付时可以关闭',
|
||||
'TRANFER_STATUS_NOT_IN_WAIT_TANSFER' => '当前转账未处于待转账状态',
|
||||
'TRANSFER_ORDER_INVALID' => '无效的转账单据',
|
||||
|
||||
@ -158,7 +158,7 @@ return [
|
||||
|
||||
'status_wait' => '待支付',
|
||||
'status_ing' => '支付中',
|
||||
'status_ed' => '已支付',
|
||||
'status_finish' => '已支付',
|
||||
'status_cancle' => '已取消',
|
||||
'status_audit' => '待审核',
|
||||
'pay' => '收款',
|
||||
@ -211,6 +211,7 @@ return [
|
||||
'member_my_point' => '我的积分',
|
||||
'member_my_commission' => '我的佣金',
|
||||
'member_my_personal' => '个人资料',
|
||||
'member_my_address' => '收货地址',
|
||||
|
||||
'diy_page' => '自定义页面',
|
||||
'diy_link' => '自定义链接'
|
||||
@ -270,6 +271,7 @@ return [
|
||||
'unipay' => '银联原路退款',
|
||||
'offline' => '线下退款',
|
||||
'balance' => '退款到余额',
|
||||
'back' => '原路退款',
|
||||
],
|
||||
'dict_order_refund' => [
|
||||
'refunding' => '退款中',
|
||||
|
||||
@ -41,6 +41,20 @@ class Diy extends BaseModel
|
||||
*/
|
||||
protected $name = 'diy_page';
|
||||
|
||||
/**
|
||||
* 状态字段转化
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return mixed
|
||||
*/
|
||||
public function getTypePageAttr($value, $data)
|
||||
{
|
||||
if (!empty($data[ 'type' ])) {
|
||||
return TemplateDict::getTemplate([ 'type' => [ $data[ 'type' ] ] ])[ $data[ 'type' ] ][ 'page' ] ?? '';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态字段转化
|
||||
* @param $value
|
||||
|
||||
@ -57,8 +57,8 @@ class AccountLog extends BaseModel
|
||||
{
|
||||
return match ($data['type']) {
|
||||
'pay' => (new Pay())->where([['out_trade_no', '=', $data['trade_no']]])->append(['type_name'])->findOrEmpty()->toArray(),
|
||||
'refund' => (new Refund())->where([['refund_no', '=', $data['trade_no']]])->findOrEmpty()->toArray(),
|
||||
'transfer' => (new Transfer())->where([['transfer_no', '=', $data['trade_no']]])->findOrEmpty()->toArray(),
|
||||
'refund' => (new Refund())->where([['refund_no', '=', $data['trade_no']]])->append(['type_name'])->findOrEmpty()->toArray(),
|
||||
'transfer' => (new Transfer())->where([['transfer_no', '=', $data['trade_no']]])->append(['transfer_type_name'])->findOrEmpty()->toArray(),
|
||||
default => [],
|
||||
};
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
|
||||
namespace app\model\pay;
|
||||
|
||||
use app\dict\pay\PayDict;
|
||||
use app\dict\pay\RefundDict;
|
||||
use core\base\BaseModel;
|
||||
|
||||
@ -40,7 +41,7 @@ class Refund extends BaseModel
|
||||
];
|
||||
|
||||
/**
|
||||
* 状态字段转化
|
||||
* 支付状态字段转化
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return mixed
|
||||
@ -60,7 +61,76 @@ class Refund extends BaseModel
|
||||
public function getTypeNameAttr($value, $data)
|
||||
{
|
||||
if (empty($data['type'])) return '';
|
||||
return RefundDict::getType()[$data['type']] ?? '';
|
||||
return PayDict::getPayType()[$data['type']]['name'] ?? '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款方式
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return mixed|string
|
||||
*
|
||||
*/
|
||||
public function getRefundTypeNameAttr($value, $data)
|
||||
{
|
||||
if (empty($data['refund_type'])) return '';
|
||||
return RefundDict::getType()[$data['refund_type']] ?? '';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 创建时间搜索器
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
*/
|
||||
public function searchCreateTimeAttr($query, $value, $data)
|
||||
{
|
||||
$start_time = empty($value[0]) ? 0 : strtotime($value[0]);
|
||||
$end_time = empty($value[1]) ? 0 : strtotime($value[1]);
|
||||
if ($start_time > 0 && $end_time > 0) {
|
||||
$query->whereBetweenTime('create_time', $start_time, $end_time);
|
||||
} else if ($start_time > 0 && $end_time == 0) {
|
||||
$query->where([['create_time', '>=', $start_time]]);
|
||||
} else if ($start_time == 0 && $end_time > 0) {
|
||||
$query->where([['create_time', '<=', $end_time]]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询交易流水号
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @return void
|
||||
*/
|
||||
public function searchOutTradeNoAttr($query, $value) {
|
||||
if (!empty($value)) {
|
||||
$query->whereLike([['out_trade_no', '%'.$value.'%']]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款号查询
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @return void
|
||||
*/
|
||||
public function searchRefundNoAttr($query, $value) {
|
||||
if (!empty($value)) {
|
||||
$query->whereLike([['refund_no', '%'.$value.'%']]);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 查询交易状态
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @return void
|
||||
*/
|
||||
public function searchStatusAttr($query, $value) {
|
||||
if ($value != '') {
|
||||
$query->where([['status', '=', $value]]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ class DiyService extends BaseAdminService
|
||||
{
|
||||
$field = 'id,title,name,template,type,mode,is_default,share,visit_count,create_time,update_time';
|
||||
$order = "update_time desc";
|
||||
$search_model = $this->model->withSearch([ "title", "type", 'mode' ], $where)->field($field)->order($order)->append([ 'type_name' ]);
|
||||
$search_model = $this->model->withSearch([ "title", "type", 'mode' ], $where)->field($field)->order($order)->append([ 'type_name', 'type_page' ]);
|
||||
return $this->pageQuery($search_model);
|
||||
}
|
||||
|
||||
@ -185,7 +185,8 @@ class DiyService extends BaseAdminService
|
||||
$data = $this->getInfoByName($params[ 'name' ]);
|
||||
} elseif (!empty($params[ 'url' ])) {
|
||||
foreach ($template as $k => $v) {
|
||||
if ($params[ 'url' ] == '/' . $v[ 'page' ]) {
|
||||
|
||||
if ($params[ 'url' ] == $v[ 'page' ]) {
|
||||
$params[ 'name' ] = $k;
|
||||
$params[ 'type' ] = $k;
|
||||
}
|
||||
@ -197,7 +198,11 @@ class DiyService extends BaseAdminService
|
||||
if (isset($template[ $data[ 'type' ] ])) {
|
||||
$page = $template[ $data[ 'type' ] ];
|
||||
$data[ 'type_name' ] = $page[ 'title' ];
|
||||
$data[ 'page' ] = $page[ 'page' ];
|
||||
if ($data[ 'is_default' ] == 1) {
|
||||
$data[ 'page' ] = $page[ 'page' ];
|
||||
} else {
|
||||
$data[ 'page' ] = $template[ 'DIY_PAGE' ][ 'page' ];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -473,12 +478,12 @@ class DiyService extends BaseAdminService
|
||||
if (!empty($page_data)) {
|
||||
if ($info[ 'is_change' ] == 1) {
|
||||
// 修改过模板,预览实际内容
|
||||
$use_template[ 'url' ] = '/' . $v[ 'page' ] . '?id=' . $info[ 'id' ];
|
||||
$use_template[ 'url' ] = $v[ 'page' ] . '?id=' . $info[ 'id' ];
|
||||
} else {
|
||||
$use_template[ 'cover' ] = $page_data[ 'cover' ]; // 默认图
|
||||
$use_template[ 'desc' ] = $page_data[ 'desc' ];
|
||||
if (empty($page_data[ 'cover' ])) {
|
||||
$use_template[ 'url' ] = '/' . $v[ 'page' ] . '?id=' . $info[ 'id' ];
|
||||
$use_template[ 'url' ] = $v[ 'page' ] . '?id=' . $info[ 'id' ];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -512,7 +517,7 @@ class DiyService extends BaseAdminService
|
||||
|
||||
// 如果没有预览图,并且没有地址,则赋值
|
||||
if (empty($use_template[ 'cover' ]) && empty($use_template[ 'url' ])) {
|
||||
$use_template[ 'url' ] = '/' . $v[ 'page' ];
|
||||
$use_template[ 'url' ] = $v[ 'page' ];
|
||||
}
|
||||
|
||||
$template[ $k ][ 'use_template' ] = $use_template;
|
||||
@ -525,7 +530,6 @@ class DiyService extends BaseAdminService
|
||||
* 切换模板
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
public function changeTemplate(array $params = [])
|
||||
{
|
||||
@ -634,38 +638,4 @@ class DiyService extends BaseAdminService
|
||||
return $info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取页面预览数据
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
public function getPreviewData(array $params = [])
|
||||
{
|
||||
$info = [];
|
||||
if (!empty($params[ 'id' ])) {
|
||||
$info = $this->getInfo($params[ 'id' ]);
|
||||
} elseif (!empty($params[ 'name' ])) {
|
||||
$info = $this->getInfoByName($params[ 'name' ]);
|
||||
}
|
||||
|
||||
$res = [
|
||||
'page' => $this->getTemplate([ 'type' => [ 'DIY_PAGE' ] ])[ 'DIY_PAGE' ][ 'page' ]
|
||||
];
|
||||
|
||||
if (!empty($info)) {
|
||||
if ($info[ 'is_default' ] == 1) {
|
||||
$template = $this->getTemplate([ 'type' => [ $info[ 'type' ] ] ])[ $info[ 'type' ] ];
|
||||
$res[ 'page' ] = $template[ 'page' ] . '?id=' . $info[ 'id' ];
|
||||
} else {
|
||||
$res[ 'page' ] .= '?id=' . $info[ 'id' ];
|
||||
}
|
||||
} elseif ($params[ 'name' ]) {
|
||||
// 表里没有数据,查询默认页面数据
|
||||
$template = $this->getTemplate([ 'type' => [ $params[ 'name' ] ] ])[ $params[ 'name' ] ];
|
||||
$res[ 'page' ] = $template[ 'page' ];
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
}
|
||||
@ -368,9 +368,9 @@ abstract class BaseGenerator
|
||||
} elseif (str_starts_with($type, 'timestamp')) {
|
||||
$result = time();
|
||||
} elseif (str_starts_with($type, 'datetime')) {
|
||||
$result = date('Y-m-d H:i:s');
|
||||
$result = '"'.date('Y-m-d H:i:s').'"';
|
||||
} elseif (str_starts_with($type, 'date')) {
|
||||
$result = date('Y-m-d H:i:s');
|
||||
$result = '"'.date('Y-m-d H:i:s').'"';
|
||||
} else {
|
||||
$result = '""';
|
||||
}
|
||||
|
||||
@ -16,6 +16,7 @@ use app\service\core\niucloud\CoreAuthService;
|
||||
use app\service\core\sys\CoreConfigService;
|
||||
use core\base\BaseAdminService;
|
||||
use core\exception\CommonException;
|
||||
use core\util\niucloud\BaseNiucloudClient;
|
||||
|
||||
/**
|
||||
* 消息管理服务层
|
||||
@ -44,6 +45,8 @@ class NiucloudService extends BaseAdminService
|
||||
];
|
||||
$auth_info = (new CoreAuthService($data['auth_code'], $data['auth_secret']))->getAuthInfo()['data'] ?? [];
|
||||
if (empty($auth_info)) throw new CommonException('AUTH_NOT_EXISTS');
|
||||
//清除access_token缓存
|
||||
(new BaseNiucloudClient())->clearAccessToken();
|
||||
return $this->core_config_service->setConfig(ConfigKeyDict::NIUCLOUD_CONFIG, $data);
|
||||
}
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ class AccountLogService extends BaseAdminService
|
||||
{
|
||||
|
||||
$field = 'id, type, money, trade_no, create_time';
|
||||
$search_model = $this->model->withSearch([ 'create_time', 'type' ], $where)->field($field)->append([ 'type_name', 'pay_info', 'money' ])->order('create_time desc');
|
||||
$search_model = $this->model->withSearch([ 'create_time', 'type' ], $where)->field($field)->append([ 'type_name', 'money', 'pay_info' ])->order('create_time desc');
|
||||
return $this->pageQuery($search_model);
|
||||
}
|
||||
|
||||
@ -51,8 +51,7 @@ class AccountLogService extends BaseAdminService
|
||||
public function getInfo(int $id)
|
||||
{
|
||||
$field = 'id, type, money, trade_no, create_time';
|
||||
return $this->model->where([ ['id', '=', $id]])->field($field)->append([ 'type_name', 'pay_info' ])->findOrEmpty()->toArray();
|
||||
|
||||
return $this->model->where([ [ 'id', '=', $id ] ])->field($field)->append([ 'type_name', 'pay_info' ])->findOrEmpty()->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -62,9 +61,9 @@ class AccountLogService extends BaseAdminService
|
||||
public function stat()
|
||||
{
|
||||
return [
|
||||
'pay' => $this->model->where([ ['type', '=', 'pay']])->sum("money")*1,
|
||||
'refund' => $this->model->where([ ['type', '=', 'refund']])->sum("money")*-1,
|
||||
'transfer' => $this->model->where([['type', '=', 'transfer']])->sum("money")*-1,
|
||||
'pay' => $this->model->where([ [ 'type', '=', 'pay' ] ])->sum("money") * 1,
|
||||
'refund' => $this->model->where([ [ 'type', '=', 'refund' ] ])->sum("money") * -1,
|
||||
'transfer' => $this->model->where([ [ 'type', '=', 'transfer' ] ])->sum("money") * -1,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
67
niucloud/app/service/admin/pay/RefundService.php
Normal file
67
niucloud/app/service/admin/pay/RefundService.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\service\admin\pay;
|
||||
|
||||
use app\dict\pay\PayDict;
|
||||
use app\model\pay\Pay;
|
||||
use app\model\pay\Refund;
|
||||
use app\service\core\pay\CoreRefundService;
|
||||
use app\service\core\paytype\CoreOfflineService;
|
||||
use core\base\BaseAdminService;
|
||||
|
||||
/**
|
||||
* 退款服务层
|
||||
*/
|
||||
class RefundService extends BaseAdminService
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->model = new Refund();
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款账户记录
|
||||
* @param array $where
|
||||
* @return mixed
|
||||
*/
|
||||
public function getPage(array $where){
|
||||
$field = 'id,refund_no,out_trade_no,type,channel,money,reason,status,create_time,refund_time,close_time,fail_reason,voucher,trade_type,trade_id,refund_type,main_type,main_id';
|
||||
$search_model = $this->model->withSearch([ 'create_time', 'out_trade_no', 'refund_no', 'status' ], $where)->field($field)->append([ 'type_name', 'status_name' ])->order('create_time desc');
|
||||
return $this->pageQuery($search_model);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取退款详情
|
||||
* @param string $refund_no
|
||||
* @return void
|
||||
*/
|
||||
public function getDetail(string $refund_no){
|
||||
$field = 'id,refund_no,out_trade_no,type,channel,money,reason,status,create_time,refund_time,close_time,fail_reason,voucher,trade_type,trade_id,refund_type,main_type,main_id';
|
||||
return $this->model->where([ ['refund_no', '=', $refund_no ] ])
|
||||
->field($field)
|
||||
->append([ 'type_name', 'status_name', 'refund_type_name' ])
|
||||
->findOrEmpty()
|
||||
->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付审核通过
|
||||
* @param array $data
|
||||
* @return null
|
||||
*/
|
||||
public function refund(array $data) {
|
||||
return (new CoreRefundService())->refund($data['refund_no'], $data['voucher'], $data['refund_type'], PayDict::STORE, $this->uid);
|
||||
}
|
||||
|
||||
}
|
||||
@ -62,9 +62,11 @@ class MenuService extends BaseAdminService
|
||||
*/
|
||||
public function edit(string $menu_key, array $data)
|
||||
{
|
||||
// $menu = $this->find($menu_key);
|
||||
// if($menu->isEmpty()) throw new AdminException();
|
||||
// if($menu['source'] != MenuDict::CREATE) throw new AdminException('');
|
||||
// if($menu_key != $data['menu_key'])
|
||||
// {
|
||||
// $menu = $this->find($data['menu_key']);
|
||||
// if(!$menu->isEmpty()) throw new AdminException('validate_menu.exit_menu_key');//创建失败
|
||||
// }
|
||||
$where = array(
|
||||
['menu_key', '=', $menu_key]
|
||||
);
|
||||
@ -107,10 +109,31 @@ class MenuService extends BaseAdminService
|
||||
$menu = $this->find($menu_key);
|
||||
if ($menu->isEmpty())
|
||||
throw new AdminException('MENU_NOT_EXIST');
|
||||
if((new SysMenu())->where([['parent_key', '=', $menu_key]])->count() > 0)
|
||||
throw new AdminException('MENU_NOT_ALLOW_DELETE');
|
||||
|
||||
$res = $menu->delete();
|
||||
if($menu['addon'] != '')
|
||||
{
|
||||
$where[] = ['addon','=',$menu['addon']];
|
||||
$count = (new SysMenu())->where([['addon','=',$menu['addon']]])->group('parent_key')->count();
|
||||
}else{
|
||||
$count = (new SysMenu())->where([['addon','=','']])->group('parent_key')->count();
|
||||
}
|
||||
if($count == 0)
|
||||
{
|
||||
$menu_where[] = ['menu_key','=',$menu_key];
|
||||
}else{
|
||||
for ($i = 0; $i<= $count; $i++)
|
||||
{
|
||||
$key[$i] = [$menu_key];
|
||||
|
||||
$where[] = ['parent_key','in',$key[$i]];
|
||||
$chilren[$i] = (new SysMenu())->where($where)->field('menu_key')->select()->toArray();
|
||||
$chilren_key[$i] = array_column($chilren[$i],'menu_key');
|
||||
$key = array_merge($key[$i],$chilren_key[$i]);
|
||||
$key = array_unique($key);
|
||||
}
|
||||
$menu_where[] = ['menu_key','in',$key];
|
||||
}
|
||||
$res = (new SysMenu())->where($menu_where)->delete();
|
||||
Cache::tag(self::$cache_tag_name)->clear();
|
||||
return $res;
|
||||
}
|
||||
|
||||
@ -35,7 +35,6 @@ class UserService extends BaseAdminService
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->model = new SysUser();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -54,7 +53,7 @@ class UserService extends BaseAdminService
|
||||
if (!empty($where['role'])) {
|
||||
$search['role_ids'] = $where['role'];
|
||||
}
|
||||
$search_model = $this->model->withSearch(['username', 'realname', 'create_time', 'role_ids'], $search)->field($field)->order('uid desc')->append(['status_name']);
|
||||
$search_model = (new SysUser())->withSearch(['username', 'realname', 'create_time', 'role_ids'], $search)->field($field)->order('uid desc')->append(['status_name']);
|
||||
return $this->pageQuery($search_model, function ($item, $key) {
|
||||
$role_ids = $item['role_ids'] ?? [];
|
||||
$item->role_data = $this->getRoleByUserRoleIds($role_ids);
|
||||
@ -72,7 +71,7 @@ class UserService extends BaseAdminService
|
||||
['uid', '=', $uid],
|
||||
);
|
||||
$field = 'uid, username, head_img, real_name, last_ip, last_time, create_time, login_count, status, delete_time, update_time, role_ids, is_admin';
|
||||
$user = $this->model->where($where)->field($field)->findOrEmpty();
|
||||
$user = (new SysUser())->where($where)->field($field)->findOrEmpty();
|
||||
if ($user->isEmpty())
|
||||
return [];
|
||||
|
||||
@ -103,7 +102,7 @@ class UserService extends BaseAdminService
|
||||
'is_admin' => $data['is_admin'],
|
||||
'role_ids' => $data['role_ids'],
|
||||
];
|
||||
$user = $this->model->create($user_data);
|
||||
$user = (new SysUser())->create($user_data);
|
||||
return $user?->uid;
|
||||
}
|
||||
|
||||
@ -188,7 +187,7 @@ class UserService extends BaseAdminService
|
||||
*/
|
||||
public function checkUsername($username)
|
||||
{
|
||||
$count = $this->model->where([['username', '=', $username]])->count();
|
||||
$count = (new SysUser())->where([['username', '=', $username]])->count();
|
||||
if($count > 0)
|
||||
{
|
||||
return true;
|
||||
@ -203,7 +202,7 @@ class UserService extends BaseAdminService
|
||||
*/
|
||||
public function find(int $uid){
|
||||
|
||||
$user = $this->model->findOrEmpty($uid);
|
||||
$user = (new SysUser())->findOrEmpty($uid);
|
||||
if ($user->isEmpty())
|
||||
throw new AdminException('USER_NOT_EXIST');
|
||||
return $user;
|
||||
@ -266,7 +265,7 @@ class UserService extends BaseAdminService
|
||||
$where = [
|
||||
['uid', '=', $uid]
|
||||
];
|
||||
$this->model->where($where)->delete();
|
||||
(new SysUser())->where($where)->delete();
|
||||
return true;
|
||||
|
||||
}
|
||||
@ -277,7 +276,7 @@ class UserService extends BaseAdminService
|
||||
* @return SysUser|array|mixed|Model
|
||||
*/
|
||||
public function getUserInfoByUsername(string $username){
|
||||
return $this->model->where([['username', '=',$username]])->findOrEmpty();
|
||||
return (new SysUser())->where([['username', '=',$username]])->findOrEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -294,7 +293,7 @@ class UserService extends BaseAdminService
|
||||
['uid', '=', $uid],
|
||||
);
|
||||
$field = 'uid, username, head_img, real_name, last_ip, last_time, create_time, login_count, status, delete_time, update_time, role_ids, is_admin';
|
||||
$user = $this->model->where($where)->field($field)->append(['status_name'])->findOrEmpty();
|
||||
$user = (new SysUser())->where($where)->field($field)->append(['status_name'])->findOrEmpty();
|
||||
return $user->toArray();
|
||||
},
|
||||
[self::$cache_tag_name, RoleService::$cache_tag_name]
|
||||
|
||||
@ -41,7 +41,7 @@ class DiyService extends BaseApiService
|
||||
$diy_config_service = new DiyConfigService();
|
||||
$start_up_page = $diy_config_service->getStartUpPageConfig($params[ 'name' ]);
|
||||
|
||||
if (!empty($start_up_page) && $start_up_page[ 'mode' ] == 'other') {
|
||||
if (!empty($start_up_page) && $start_up_page[ 'mode' ] == 'other' && $params[ 'name' ] != $start_up_page[ 'type' ]) {
|
||||
$info = $start_up_page;
|
||||
return $info;
|
||||
} else {
|
||||
|
||||
@ -35,7 +35,7 @@ class AddressService extends BaseApiService
|
||||
*/
|
||||
public function getList(array $where = [])
|
||||
{
|
||||
$field = 'id,member_id,name,mobile,province_id,city_id,district_id,address,full_address,lng,lat,is_default,type';
|
||||
$field = 'id,member_id,name,mobile,address,address_name,full_address,is_default,type';
|
||||
$order = 'is_default desc, id desc';
|
||||
|
||||
$list = $this->model->where([ ['member_id', '=', $this->member_id ] ])->withSearch(["type"], $where)->field($field)->order($order)->select()->toArray();
|
||||
@ -49,7 +49,7 @@ class AddressService extends BaseApiService
|
||||
*/
|
||||
public function getInfo(int $id)
|
||||
{
|
||||
$field = 'id,member_id,name,mobile,province_id,city_id,district_id,address,full_address,lng,lat,is_default,type';
|
||||
$field = 'id,member_id,name,mobile,province_id,city_id,district_id,address,address_name,full_address,lng,lat,is_default,type';
|
||||
|
||||
$info = $this->model->field($field)->where([ ['id', '=', $id], ['member_id', '=', $this->member_id ] ])->findOrEmpty()->toArray();
|
||||
return $info;
|
||||
@ -63,7 +63,7 @@ class AddressService extends BaseApiService
|
||||
public function add(array $data)
|
||||
{
|
||||
if ($data['is_default']) {
|
||||
$this->model->where([ ['member_id', '=', $this->member_id ] ])->update(['is_default' => 0]);
|
||||
$this->model->where([ ['member_id', '=', $this->member_id ], ['type', '=', $data['type']] ])->update(['is_default' => 0]);
|
||||
}
|
||||
$data['member_id'] = $this->member_id;
|
||||
$res = $this->model->create($data);
|
||||
@ -79,7 +79,7 @@ class AddressService extends BaseApiService
|
||||
public function edit(int $id, array $data)
|
||||
{
|
||||
if ($data['is_default']) {
|
||||
$this->model->where([ ['member_id', '=', $this->member_id ] ])->update(['is_default' => 0]);
|
||||
$this->model->where([ ['member_id', '=', $this->member_id ], ['type', '=', $data['type']] ])->update(['is_default' => 0]);
|
||||
}
|
||||
$this->model->where([ ['id', '=', $id], ['member_id', '=', $this->member_id ] ])->update($data);
|
||||
return true;
|
||||
|
||||
@ -90,7 +90,16 @@ class PayService extends BaseApiService
|
||||
return $this->core_pay_service->getInfoByOutTradeNo($out_trade_no, $this->channel);
|
||||
}
|
||||
|
||||
public function getInfoByTrade(string $trade_type, int $trade_id){
|
||||
/**
|
||||
* 支付信息
|
||||
* @param string $trade_type
|
||||
* @param int $trade_id
|
||||
* @return array
|
||||
* @throws DataNotFoundException
|
||||
* @throws DbException
|
||||
* @throws ModelNotFoundException
|
||||
*/
|
||||
public function getInfoByTrade(string $trade_type, $trade_id){
|
||||
return $this->core_pay_service->getInfoByTrade($trade_type, $trade_id, $this->channel);
|
||||
}
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@ trait WapTrait
|
||||
$file_name = 'diy-' . $path;
|
||||
|
||||
$content .= " <template v-if=\"component.componentName == '{$name}'\">\n";
|
||||
$content .= " <$file_name :component=\"component\" :index=\"index\" :pullDownRefresh=\"props.pullDownRefresh\"></$file_name>\n";
|
||||
$content .= " <$file_name :component=\"component\" :index=\"index\" :pullDownRefreshCount=\"props.pullDownRefreshCount\"></$file_name>\n";
|
||||
$content .= " </template>\n";
|
||||
}
|
||||
}
|
||||
@ -97,7 +97,7 @@ trait WapTrait
|
||||
$file_name = 'diy-' . $path;
|
||||
|
||||
$content .= " <template v-if=\"component.componentName == '{$name}'\">\n";
|
||||
$content .= " <$file_name :component=\"component\" :index=\"index\" :pullDownRefresh=\"props.pullDownRefresh\"></$file_name>\n";
|
||||
$content .= " <$file_name :component=\"component\" :index=\"index\" :pullDownRefreshCount=\"props.pullDownRefreshCount\"></$file_name>\n";
|
||||
$content .= " </template>\n";
|
||||
|
||||
$addon_import_content .= " import diy{$name} from '@/" . $v . "/components/diy/{$path}/index.vue';\n";
|
||||
@ -125,7 +125,7 @@ trait WapTrait
|
||||
$content .= " import Sortable from 'sortablejs';\n";
|
||||
$content .= " import { range } from 'lodash-es';\n";
|
||||
|
||||
$content .= " const props = defineProps(['data','pullDownRefresh']);\n";
|
||||
$content .= " const props = defineProps(['data','pullDownRefreshCount']);\n";
|
||||
$content .= " const diyStore = useDiyStore();\n\n";
|
||||
|
||||
$content .= " const data = computed(() => {\n";
|
||||
@ -200,7 +200,7 @@ trait WapTrait
|
||||
$file_name = 'fixed-' . $path;
|
||||
|
||||
$content .= " <template v-if=\"props.data.global.component == '{$path}'\">\n";
|
||||
$content .= " <$file_name :data=\"props.data\" :pullDownRefresh=\"props.pullDownRefresh\"></$file_name>\n";
|
||||
$content .= " <$file_name :data=\"props.data\" :pullDownRefreshCount=\"props.pullDownRefreshCount\"></$file_name>\n";
|
||||
$content .= " </template>\n";
|
||||
}
|
||||
}
|
||||
@ -239,7 +239,7 @@ trait WapTrait
|
||||
$file_name = 'fixed-' . $path;
|
||||
|
||||
$content .= " <template v-if=\"props.data.global.component == '{$path}'\">\n";
|
||||
$content .= " <$file_name :data=\"props.data\" :pullDownRefresh=\"props.pullDownRefresh\"></$file_name>\n";
|
||||
$content .= " <$file_name :data=\"props.data\" :pullDownRefreshCount=\"props.pullDownRefreshCount\"></$file_name>\n";
|
||||
$content .= " </template>\n";
|
||||
|
||||
$addon_import_content .= " import fixed{$name} from '@/" . $v . "/components/fixed/{$path}/index.vue';\n";
|
||||
@ -255,7 +255,7 @@ trait WapTrait
|
||||
if (!empty($addon_import_content)) {
|
||||
$content .= $addon_import_content;
|
||||
}
|
||||
$content .= " const props = defineProps(['data','pullDownRefresh']);\n";
|
||||
$content .= " const props = defineProps(['data','pullDownRefreshCount']);\n";
|
||||
$content .= "</script>\n";
|
||||
|
||||
$content .= "<style lang=\"scss\" scoped>\n";
|
||||
|
||||
@ -45,6 +45,9 @@ class CoreDiyConfigService extends BaseCoreService
|
||||
|
||||
$info = [
|
||||
'backgroundColor' => '#ffffff',
|
||||
'textColor' => '#606266',
|
||||
'textHoverColor' => '#007aff',
|
||||
'type' => 1,
|
||||
'list' => [
|
||||
[
|
||||
"text" => "首页",
|
||||
@ -68,10 +71,7 @@ class CoreDiyConfigService extends BaseCoreService
|
||||
"iconPath" => "static/resource/images/tabbar/my.png",
|
||||
"iconSelectPath" => "static/resource/images/tabbar/my-selected.png"
|
||||
]
|
||||
],
|
||||
'textColor' => '#606266',
|
||||
'textHoverColor' => '#007aff',
|
||||
'type' => 1
|
||||
]
|
||||
];
|
||||
}
|
||||
return $info;
|
||||
|
||||
@ -39,9 +39,9 @@ class CoreMemberAddressService extends BaseCoreService
|
||||
* @param int $member_id
|
||||
* @return array
|
||||
*/
|
||||
public function getDefaultAddressByMemberId(int $member_id){
|
||||
public function getDefaultAddressByMemberId(int $member_id, $type = 'address'){
|
||||
$field = 'id,member_id,name,mobile,province_id,city_id,district_id,address,full_address,lng,lat,is_default,type';
|
||||
return $this->model->where([['member_id', '=', $member_id]])->field($field)->findOrEmpty()->toArray();
|
||||
return $this->model->where([['member_id', '=', $member_id], ['type', '=', $type] ])->field($field)->order('is_default desc')->findOrEmpty()->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -53,4 +53,4 @@ class CoreMemberAddressService extends BaseCoreService
|
||||
$field = 'id,member_id,name,mobile,province_id,city_id,district_id,address,full_address,lng,lat,is_default,type';
|
||||
return $this->model->where([['id', '=', $id], ['member_id', '=', $member_id]])->field($field)->findOrEmpty()->toArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,9 +31,9 @@ class CoreAuthService extends BaseNiucloudClient
|
||||
public function getAuthInfo()
|
||||
{
|
||||
$auth_info = $this->httpGet('authinfo', ['code' => $this->code, 'secret' => $this->secret]);
|
||||
if(!empty($auth_info['data'])){
|
||||
$auth_info['data']['address_type'] = $this->diffDomain($auth_info['data']['site_address'], $_SERVER['HTTP_HOST']);
|
||||
}
|
||||
// if(!empty($auth_info['data'])){
|
||||
// $auth_info['data']['address_type'] = $this->diffDomain($auth_info['data']['site_address'], $_SERVER['HTTP_HOST']);
|
||||
// }
|
||||
return $auth_info;
|
||||
}
|
||||
|
||||
|
||||
@ -27,9 +27,10 @@ class CoreModuleService extends BaseNiucloudClient
|
||||
public function getModuleList()
|
||||
{
|
||||
$params = [
|
||||
'app_type' => ''
|
||||
'app_type' => '',
|
||||
'code' => $this->code,
|
||||
'secret' => $this->secret
|
||||
];
|
||||
|
||||
return $this->httpGet('member_app_all', $params);
|
||||
}
|
||||
|
||||
@ -41,7 +42,12 @@ class CoreModuleService extends BaseNiucloudClient
|
||||
*/
|
||||
public function getAuthInfo()
|
||||
{
|
||||
return $this->httpGet('member_app');
|
||||
$params = [
|
||||
'app_type' => '',
|
||||
'code' => $this->code,
|
||||
'secret' => $this->secret
|
||||
];
|
||||
return $this->httpGet('member_app', $params);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -65,4 +71,16 @@ class CoreModuleService extends BaseNiucloudClient
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作token
|
||||
* @param $action
|
||||
* @param $data
|
||||
* @return array|\core\util\niucloud\Response|object|ResponseInterface
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function getActionToken($action, $data)
|
||||
{
|
||||
return $this->httpGet('member_app_action/'.$action, $data);
|
||||
}
|
||||
}
|
||||
|
||||
@ -130,11 +130,14 @@ class CorePayService extends BaseCoreService
|
||||
*/
|
||||
public function getInfoByTrade(string $trade_type, string $trade_id, string $channel)
|
||||
{
|
||||
$where = array(
|
||||
['trade_type', '=', $trade_type],
|
||||
['trade_id', '=', $trade_id],
|
||||
);
|
||||
$pay = $this->model->where($where)->append(['type_name', 'status_name'])->findOrEmpty()->toArray();
|
||||
$pay = $this->findPayInfoByTrade($trade_type, $trade_id);
|
||||
if ($pay->isEmpty()) {
|
||||
//创建新的支付单据
|
||||
$pay = $this->createByTrade( $trade_type, $trade_id);
|
||||
}
|
||||
if(!is_array($pay)){
|
||||
$pay = $pay->toArray();
|
||||
}
|
||||
if (!empty($pay)) {
|
||||
//todo 校验场景控制支付方式
|
||||
$pay['pay_type_list'] = array_values((new CorePayChannelService())->getAllowPayTypeByChannel($channel, $pay['trade_type']));
|
||||
@ -183,10 +186,10 @@ class CorePayService extends BaseCoreService
|
||||
if (!in_array($type, array_column((new CorePayChannelService())->getAllowPayTypeByChannel($channel, $trade_type), 'key'))) throw new PayException('PAYMENT_METHOD_NOT_SCENE');//场景不支持
|
||||
$pay_result = $this->pay_event->init($channel, $type)->pay($out_trade_no, $money, $body, $return_url, $quit_url, $buyer_id, $openid ?? '', $voucher);
|
||||
//todo 特殊支付方式会直接返回支付状态,状态如果为已支付会直接支付
|
||||
if (!empty($pay_result['status']) && $pay_result['status'] == PayDict::STATUS_ED) {
|
||||
if (!empty($pay_result['status']) && $pay_result['status'] == PayDict::STATUS_FINISH) {
|
||||
$pay->save([ 'channel' => $channel ]);
|
||||
$this->paySuccess([
|
||||
'status' => PayDict::STATUS_ED,
|
||||
'status' => PayDict::STATUS_FINISH,
|
||||
'type' => $type,
|
||||
'out_trade_no' => $out_trade_no
|
||||
]);
|
||||
@ -235,11 +238,11 @@ class CorePayService extends BaseCoreService
|
||||
//创建新的支付单据
|
||||
$pay = $this->createByTrade( $trade_type, $trade_id);
|
||||
}
|
||||
if ($pay['status'] == PayDict::STATUS_ED) throw new PayException('PAY_SUCCESS');
|
||||
if ($pay['status'] == PayDict::STATUS_FINISH) throw new PayException('PAY_SUCCESS');
|
||||
if ($pay['status'] == PayDict::STATUS_CALCLE) throw new PayException('PAY_IS_REMOVE');
|
||||
if ($pay['status'] == PayDict::STATUS_ING) {
|
||||
//尝试关闭原有的支付单据
|
||||
$this->close( $pay->out_trade_no);
|
||||
$this->close( $pay['out_trade_no']);
|
||||
//创建新的支付单据
|
||||
$pay = $this->createByTrade($trade_type, $trade_id);
|
||||
}
|
||||
@ -248,16 +251,26 @@ class CorePayService extends BaseCoreService
|
||||
|
||||
/**
|
||||
* 通过业务信息创建支付单据
|
||||
|
||||
* @param $trade_type
|
||||
* @param $trade_id
|
||||
* @return Pay|array|mixed|Model
|
||||
*/
|
||||
public function createByTrade( $trade_type, $trade_id){
|
||||
//创建新的支付单据
|
||||
$data = event('PayCreate', ['trade_type' => $trade_type, 'trade_id' => $trade_id])[0] ?? [];
|
||||
$out_trade_no = $this->create($data['main_type'], $data['main_id'], $data['money'], $data['trade_type'], $data['trade_id'], $data['body']);
|
||||
return $this->findPayInfoByOutTradeNo($out_trade_no);
|
||||
$data = array_values(array_filter(event('PayCreate', ['trade_type' => $trade_type, 'trade_id' => $trade_id])))[0] ?? [];
|
||||
if(empty($data)) throw new PayException('PAY_NOT_FOUND_TRADE');//找不到可支付的交易
|
||||
//如果订单已完成,则直接返回完成的支付信息
|
||||
if(isset($data['status']) && $data['money'] == 0){
|
||||
$data['status'] = PayDict::STATUS_FINISH;
|
||||
$data['status_name'] = PayDict::getStatus()[$data['status']] ?? '';
|
||||
$data['type'] = PayDict::BALANCEPAY;
|
||||
$data['type_name'] = PayDict::getPayType()[$data['type']]['name'] ?? '';
|
||||
return $data;
|
||||
}else{
|
||||
$out_trade_no = $this->create($data['main_type'], $data['main_id'], $data['money'], $data['trade_type'], $data['trade_id'], $data['body']);
|
||||
return $this->findPayInfoByOutTradeNo($out_trade_no);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -294,24 +307,28 @@ class CorePayService extends BaseCoreService
|
||||
public function close(string $out_trade_no)
|
||||
{
|
||||
$pay = $this->findPayInfoByOutTradeNo($out_trade_no);
|
||||
if ($pay->isEmpty()) throw new PayException('ALIPAY_TRANSACTION_NO_NOT_EXIST');
|
||||
if (empty($pay->type)) throw new PayException('TREAT_PAYMENT_IS_OPEN');
|
||||
if ($pay->isEmpty()) throw new PayException('PAY_TRANSACTION_NO_NOT_EXIST');
|
||||
// if (empty($pay->type)) throw new PayException('TREAT_PAYMENT_IS_OPEN');
|
||||
|
||||
if($pay['status'] == PayDict::STATUS_CALCLE) return true;
|
||||
if (!in_array($pay['status'], [
|
||||
PayDict::STATUS_WAIT,
|
||||
PayDict::STATUS_ING
|
||||
])) throw new PayException('TREAT_PAYMENT_IS_OPEN');
|
||||
if ($pay['status'] == PayDict::STATUS_ING) {
|
||||
//尝试取消或关闭第三方支付
|
||||
$close = $this->pay_event->init($pay->channel, $pay->type)->close($out_trade_no);
|
||||
if (!$close) {//有问题查询第三方订单详情
|
||||
$order = $this->pay_event->init($pay->channel, $pay->type)->getOrder($out_trade_no);
|
||||
if (!empty($order)) {
|
||||
if ($order['status'] == OnlinePayDict::SUCCESS) {//如果已支付,就将支付调整为已支付
|
||||
$this->paySuccess([
|
||||
'out_trade_no' => $out_trade_no,
|
||||
'type' => $pay->type
|
||||
]);
|
||||
return false;
|
||||
if (!empty($pay->type)){
|
||||
//尝试取消或关闭第三方支付
|
||||
$close = $this->pay_event->init($pay->channel, $pay->type)->close($out_trade_no);
|
||||
if (!$close) {//有问题查询第三方订单详情
|
||||
$order = $this->pay_event->init($pay->channel, $pay->type)->getOrder($out_trade_no);
|
||||
if (!empty($order)) {
|
||||
if ($order['status'] == OnlinePayDict::SUCCESS) {//如果已支付,就将支付调整为已支付
|
||||
$this->paySuccess([
|
||||
'out_trade_no' => $out_trade_no,
|
||||
'type' => $pay->type
|
||||
]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -332,13 +349,14 @@ class CorePayService extends BaseCoreService
|
||||
public function closeByTrade(string $trade_type, int $trade_id)
|
||||
{
|
||||
$pay = $this->findPayInfoByTrade( $trade_type, $trade_id);
|
||||
if ($pay->isEmpty()) throw new PayException('ALIPAY_TRANSACTION_NO_NOT_EXIST');
|
||||
if ($pay['status'] == PayDict::STATUS_ED) throw new PayException('DOCUMENT_IS_PAID');//当前单据已支付
|
||||
// if ($pay->isEmpty()) throw new PayException('PAY_TRANSACTION_NO_NOT_EXIST');
|
||||
if ($pay->isEmpty()) return true;
|
||||
if ($pay['status'] == PayDict::STATUS_FINISH) throw new PayException('DOCUMENT_IS_PAID');//当前单据已支付
|
||||
if (!in_array($pay['status'], [
|
||||
PayDict::STATUS_WAIT,
|
||||
PayDict::STATUS_ING
|
||||
])) throw new PayException('IS_PAY_REMOVE_NOT_RESETTING');//只有待支付可以关闭支付
|
||||
if (!$this->close($pay)) {
|
||||
if (!$this->close($pay['out_trade_no'])) {
|
||||
throw new PayException('DOCUMENT_IS_PAY_REMOVE');
|
||||
}
|
||||
return true;
|
||||
@ -355,8 +373,8 @@ class CorePayService extends BaseCoreService
|
||||
{
|
||||
$pay = $this->findPayInfoByOutTradeNo( $out_trade_no);
|
||||
|
||||
if ($pay->isEmpty()) throw new PayException('ALIPAY_TRANSACTION_NO_NOT_EXIST');
|
||||
if ($pay['status'] == PayDict::STATUS_ED) throw new PayException('DOCUMENT_IS_PAID');
|
||||
if ($pay->isEmpty()) throw new PayException('PAY_TRANSACTION_NO_NOT_EXIST');
|
||||
if ($pay['status'] == PayDict::STATUS_FINISH) throw new PayException('DOCUMENT_IS_PAID');
|
||||
if ($pay['status'] == PayDict::STATUS_CALCLE) throw new PayException('PAY_IS_REMOVE');
|
||||
$status = $params['status'];
|
||||
switch ($status) {
|
||||
@ -421,8 +439,8 @@ class CorePayService extends BaseCoreService
|
||||
{
|
||||
$out_trade_no = $data['out_trade_no'];
|
||||
$pay = $this->findPayInfoByOutTradeNo($out_trade_no);
|
||||
if ($pay->isEmpty()) throw new PayException('ALIPAY_TRANSACTION_NO_NOT_EXIST');
|
||||
if ($pay['status'] == PayDict::STATUS_ED) throw new PayException('PAY_SUCCESS');//单据已支付
|
||||
if ($pay->isEmpty()) throw new PayException('PAY_TRANSACTION_NO_NOT_EXIST');
|
||||
if ($pay['status'] == PayDict::STATUS_FINISH) throw new PayException('PAY_SUCCESS');//单据已支付
|
||||
if ($pay['status'] == PayDict::STATUS_CALCLE) throw new PayException('PAY_IS_REMOVE');//单据已取消
|
||||
//查询第三方支付单据
|
||||
$pay_info = $this->pay_event->init($pay->channel, $pay->type)->getOrder($out_trade_no);
|
||||
@ -468,7 +486,7 @@ class CorePayService extends BaseCoreService
|
||||
$trade_id = $pay->trade_id;
|
||||
$data = array(
|
||||
'pay_time' => time(),
|
||||
'status' => PayDict::STATUS_ED,
|
||||
'status' => PayDict::STATUS_FINISH,
|
||||
'type' => $type,
|
||||
'trade_no' => $params['trade_no'] ?? '',
|
||||
'voucher' => $params['voucher'] ?? '',
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
|
||||
namespace app\service\core\pay;
|
||||
|
||||
use app\dict\pay\PayDict;
|
||||
use app\dict\pay\RefundDict;
|
||||
use app\model\pay\Refund;
|
||||
use core\base\BaseCoreService;
|
||||
@ -40,10 +41,10 @@ class CoreRefundService extends BaseCoreService
|
||||
* @param string $reason
|
||||
* @return string|null
|
||||
*/
|
||||
public function create( string $out_trade_no, float $money, string $reason = ''){
|
||||
public function create(string $out_trade_no, float $money, string $reason = '', $trade_type = '', $trade_id = ''){
|
||||
//通过交易流水号获取支付单据
|
||||
$pay = (new CorePayService())->findPayInfoByOutTradeNo( $out_trade_no);
|
||||
if($pay->isEmpty()) throw new PayException('ALIPAY_TRANSACTION_NO_NOT_EXIST');//单据不存在
|
||||
if($pay->isEmpty()) throw new PayException('PAY_TRANSACTION_NO_NOT_EXIST');//单据不存在
|
||||
//校验当前数据是否存在
|
||||
//存在就修改,不存在就创建
|
||||
$refund_no = create_no();
|
||||
@ -55,7 +56,9 @@ class CoreRefundService extends BaseCoreService
|
||||
'refund_no' => $refund_no,
|
||||
'status' => RefundDict::WAIT,
|
||||
'reason' => $reason,
|
||||
'fail_reason' => $pay->fail_reason ?? ''
|
||||
'fail_reason' => $pay->fail_reason ?? '',
|
||||
'trade_type' => $trade_type,
|
||||
'trade_id' => $trade_id
|
||||
);
|
||||
$this->model->create($data);
|
||||
return $refund_no;
|
||||
@ -67,15 +70,23 @@ class CoreRefundService extends BaseCoreService
|
||||
* @param string $voucher
|
||||
* @return true
|
||||
*/
|
||||
public function refund( string $refund_no, $voucher = ''){
|
||||
public function refund( string $refund_no, $voucher = '', $refund_type = RefundDict::BACK, $main_type = '', $main_id = 0){
|
||||
$refund = $this->findByRefundNo( $refund_no);
|
||||
if($refund->isEmpty()) throw new PayException('REFUND_NOT_EXIST');
|
||||
$out_trade_no = $refund->out_trade_no;
|
||||
$money = $refund->money;
|
||||
try{
|
||||
//判断成功的话,可以直接调用退款成功
|
||||
$pay_result = $this->pay_event->init( $refund->channel, $refund->type)->refund($out_trade_no, $money, $money, $refund_no, $voucher);
|
||||
$this->refundNotify($out_trade_no, $refund->type, $pay_result);
|
||||
//存入退款方式
|
||||
$refund->save(['refund_type' => $refund_type]);
|
||||
if($refund_type == RefundDict::BACK){
|
||||
//判断成功的话,可以直接调用退款成功
|
||||
$pay_result = $this->pay_event->init( $refund->channel, $refund->type)->refund($out_trade_no, $money, $money, $refund_no, $voucher);
|
||||
$this->refundNotify($out_trade_no, $refund->type, $pay_result);
|
||||
}else if($refund_type == RefundDict::OFFLINE){
|
||||
$pay_result = $this->pay_event->init( $refund->channel, PayDict::OFFLINEPAY)->refund($out_trade_no, $money, $money, $refund_no, $voucher);
|
||||
$this->refundNotify($out_trade_no, $refund->type, $pay_result, $main_type, $main_id);
|
||||
}
|
||||
|
||||
}catch ( Throwable $e) {
|
||||
throw new PayException($e->getMessage());
|
||||
}
|
||||
@ -95,7 +106,7 @@ class CoreRefundService extends BaseCoreService
|
||||
|
||||
|
||||
|
||||
public function refundNotify( $out_trade_no, string $type, array $params = []){
|
||||
public function refundNotify( $out_trade_no, string $type, array $params = [], $main_type = '', $main_id = 0){
|
||||
$refund_no = $params['refund_no'];
|
||||
|
||||
$refund = $this->findByRefundNo($refund_no);
|
||||
@ -112,6 +123,10 @@ class CoreRefundService extends BaseCoreService
|
||||
$this->refundSuccess( [
|
||||
'out_trade_no' => $out_trade_no,
|
||||
'refund_no' => $refund_no,
|
||||
'trade_type' => $refund['trade_type'],
|
||||
'trade_id' => $refund['trade_id'],
|
||||
'main_type' => $main_type,
|
||||
'main_id' => $main_id
|
||||
]);
|
||||
break;
|
||||
case RefundDict::DEALING://退款处理中
|
||||
@ -159,6 +174,8 @@ class CoreRefundService extends BaseCoreService
|
||||
$this->refundSuccess( [
|
||||
'out_trade_no' => $out_trade_no,
|
||||
'refund_no' => $refund_no,
|
||||
'trade_type' => $refund['trade_type'],
|
||||
'trade_id' => $refund['trade_id'],
|
||||
]);
|
||||
break;
|
||||
case RefundDict::DEALING://退款处理中
|
||||
@ -192,8 +209,8 @@ class CoreRefundService extends BaseCoreService
|
||||
])->update([
|
||||
'status' => RefundDict::SUCCESS
|
||||
]);
|
||||
$pay = (new CorePayService())->findPayInfoByOutTradeNo( $out_trade_no);
|
||||
$result = event('RefundSuccess', ['refund_no' => $refund_no, 'trade_type' => $pay->trade_type]);
|
||||
// $pay = (new CorePayService())->findPayInfoByOutTradeNo( $out_trade_no);
|
||||
$result = event('RefundSuccess', ['refund_no' => $refund_no, 'trade_type' => $data['trade_type'], 'trade_id' => $data['trade_id']]);
|
||||
if(!check_event_result($result)){
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ class CoreBalanceService extends BaseCoreService
|
||||
break;
|
||||
}
|
||||
return [
|
||||
'status' => PayDict::STATUS_ED,
|
||||
'status' => PayDict::STATUS_FINISH,
|
||||
'out_trade_no' => $out_trade_no,
|
||||
];
|
||||
//业务主体id
|
||||
|
||||
@ -40,7 +40,7 @@ class CoreOfflineService extends BaseCoreService
|
||||
if (empty($voucher)) throw new CommonException('VOUCHER_NOT_EMPTY');
|
||||
|
||||
$pay = (new CorePayService())->findPayInfoByOutTradeNo($out_trade_no);
|
||||
if ($pay->isEmpty()) throw new CommonException('ALIPAY_TRANSACTION_NO_NOT_EXIST');
|
||||
if ($pay->isEmpty()) throw new CommonException('PAY_TRANSACTION_NO_NOT_EXIST');
|
||||
|
||||
$pay->voucher = $voucher;
|
||||
$pay->save();
|
||||
@ -63,7 +63,7 @@ class CoreOfflineService extends BaseCoreService
|
||||
if (empty($voucher)) throw new CommonException('VOUCHER_NOT_EMPTY');
|
||||
|
||||
$pay = (new CoreRefundService())->findByRefundNo($refund_no);
|
||||
if ($pay->isEmpty()) throw new CommonException('ALIPAY_TRANSACTION_NO_NOT_EXIST');
|
||||
if ($pay->isEmpty()) throw new CommonException('PAY_TRANSACTION_NO_NOT_EXIST');
|
||||
|
||||
$pay->voucher = $voucher;
|
||||
$pay->save();
|
||||
@ -97,12 +97,12 @@ class CoreOfflineService extends BaseCoreService
|
||||
*/
|
||||
public function pass(string $out_trade_no) {
|
||||
$pay = (new CorePayService())->findPayInfoByOutTradeNo($out_trade_no);
|
||||
if ($pay->isEmpty()) throw new CommonException('ALIPAY_TRANSACTION_NO_NOT_EXIST');
|
||||
if ($pay->isEmpty()) throw new CommonException('PAY_TRANSACTION_NO_NOT_EXIST');
|
||||
if ($pay->status != PayDict::STATUS_AUDIT) throw new CommonException('ONLY_PAYING_CAN_AUDIT');
|
||||
if ($pay->type != PayDict::OFFLINEPAY) throw new CommonException('ONLY_OFFLINEPAY_CAN_AUDIT');
|
||||
|
||||
return (new CorePayService())->paySuccess( [
|
||||
'status' => PayDict::STATUS_ED,
|
||||
'status' => PayDict::STATUS_FINISH,
|
||||
'type' => $pay->type,
|
||||
'out_trade_no' => $out_trade_no,
|
||||
'voucher' => $pay->voucher
|
||||
@ -117,7 +117,7 @@ class CoreOfflineService extends BaseCoreService
|
||||
*/
|
||||
public function refuse(string $out_trade_no, string $reason = '') {
|
||||
$pay = (new CorePayService())->findPayInfoByOutTradeNo($out_trade_no);
|
||||
if ($pay->isEmpty()) throw new CommonException('ALIPAY_TRANSACTION_NO_NOT_EXIST');
|
||||
if ($pay->isEmpty()) throw new CommonException('PAY_TRANSACTION_NO_NOT_EXIST');
|
||||
if ($pay->status != PayDict::STATUS_AUDIT) throw new CommonException('ONLY_PAYING_CAN_AUDIT');
|
||||
if ($pay->type != PayDict::OFFLINEPAY) throw new CommonException('ONLY_OFFLINEPAY_CAN_AUDIT');
|
||||
|
||||
|
||||
@ -34,17 +34,14 @@ class Address extends BaseValidate
|
||||
protected $message = [
|
||||
'name.require' => ['common_validate.require', ['name']],
|
||||
'mobile.require' => ['common_validate.require', ['mobile']],
|
||||
'province_id.require' => ['common_validate.require', ['province_id']],
|
||||
'city_id.require' => ['common_validate.require', ['city_id']],
|
||||
'district_id.require' => ['common_validate.require', ['district_id']],
|
||||
'address.require' => ['common_validate.require', ['address']],
|
||||
'full_address.require' => ['common_validate.require', ['full_address']],
|
||||
'type.require' => ['common_validate.require', ['type']],
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
"add" => ['name', 'mobile', 'province_id', 'city_id', 'district_id', 'address', 'full_address', 'lng', 'lat', 'type'],
|
||||
"edit" => ['name', 'mobile', 'province_id', 'city_id', 'district_id', 'address', 'full_address', 'lng', 'lat', 'type']
|
||||
"add" => ['name', 'mobile', 'address', 'full_address', 'lng', 'lat', 'type'],
|
||||
"edit" => ['name', 'mobile', 'address', 'full_address', 'lng', 'lat', 'type']
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user