mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
修改订单状态
This commit is contained in:
parent
649607ebdd
commit
10774ceed6
@ -11,7 +11,7 @@
|
||||
Target Server Version : 50562
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 24/02/2021 18:31:33
|
||||
Date: 09/03/2021 17:54:24
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
@ -574,14 +574,15 @@ CREATE TABLE `shop_order` (
|
||||
`amount_express` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '快递费用金额',
|
||||
`amount_balance` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '余额抵扣金额',
|
||||
`amount_discount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '折扣后的金额',
|
||||
`truck_type` tinyint(1) NULL DEFAULT 0 COMMENT '物流配送(0无需配送,1需要配送)',
|
||||
`payment_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '实际支付平台',
|
||||
`payment_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '实际通道编号',
|
||||
`payment_trade` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '实际支付单号',
|
||||
`payment_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '实际支付状态',
|
||||
`payment_image` varchar(999) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '支付凭证图片',
|
||||
`payment_amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '实际支付金额',
|
||||
`payment_remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '支付结果描述',
|
||||
`payment_datetime` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '支付到账时间',
|
||||
`truck_type` tinyint(1) NULL DEFAULT 0 COMMENT '物流配送(0无需配送,1需要配送)',
|
||||
`number_goods` bigint(20) NULL DEFAULT 0 COMMENT '订单商品数量',
|
||||
`cancel_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '订单取消状态',
|
||||
`cancel_remark` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '订单取消描述',
|
||||
@ -589,7 +590,7 @@ CREATE TABLE `shop_order` (
|
||||
`deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '订单删除状态(0未删,1已删)',
|
||||
`deleted_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '订单删除描述',
|
||||
`deleted_datetime` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '订单删除时间',
|
||||
`status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '订单状态(0已取消,1预订单,2待支付,3待发货,4待签收,5已完成)',
|
||||
`status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '订单状态(0已取消,1预订单,2待支付,3支付中,4已支付,5已发货,6已完成)',
|
||||
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `idx_shop_order_mid`(`uid`) USING BTREE,
|
||||
@ -4660,13 +4661,14 @@ CREATE TABLE `system_data` (
|
||||
`value` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '配置值',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `idx_system_data_name`(`name`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统-数据' ROW_FORMAT = COMPACT;
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统-数据' ROW_FORMAT = COMPACT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of system_data
|
||||
-- ----------------------------
|
||||
INSERT INTO `system_data` VALUES (1, '关于我们', 'a:2:{s:4:\"name\";s:8:\"23512322\";s:7:\"content\";s:16:\"<p>512351235</p>\";}');
|
||||
INSERT INTO `system_data` VALUES (2, '用户协议', 'a:2:{s:4:\"name\";s:7:\"2315123\";s:7:\"content\";s:16:\"<p>512351235</p>\";}');
|
||||
INSERT INTO `system_data` VALUES (3, 'cropper', 'a:2:{s:5:\"image\";s:66:\"http://127.0.0.1:8000/upload/b4/e34bf60203f28f15a63b2af1c32dcb.jpg\";s:7:\"postion\";s:134:\"{\"x\":400.05633605275233,\"y\":149.0905449790871,\"width\":17.208822404146915,\"height\":17.208822404146915,\"rotate\":0,\"scaleX\":1,\"scaleY\":1}\";}');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for system_menu
|
||||
@ -4686,7 +4688,7 @@ CREATE TABLE `system_menu` (
|
||||
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `idx_system_menu_status`(`status`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 95 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统-菜单' ROW_FORMAT = COMPACT;
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 96 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统-菜单' ROW_FORMAT = COMPACT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of system_menu
|
||||
@ -4733,6 +4735,7 @@ INSERT INTO `system_menu` VALUES (91, 90, '用户等级管理', 'layui-icon layu
|
||||
INSERT INTO `system_menu` VALUES (92, 90, '用户折扣方案', 'layui-icon layui-icon-set', 'data/user_discount/index', 'data/user_discount/index', '', '_self', 0, 1, '2021-01-27 05:44:51');
|
||||
INSERT INTO `system_menu` VALUES (93, 90, '用户提现管理', 'layui-icon layui-icon-component', 'data/user_transfer/index', 'data/user_transfer/index', '', '_self', 0, 1, '2021-01-28 06:48:34');
|
||||
INSERT INTO `system_menu` VALUES (94, 68, '页面内容管理', 'layui-icon layui-icon-read', 'data/config/pagehome', 'data/config/pagehome', '', '_self', 20, 1, '2021-02-24 08:49:16');
|
||||
INSERT INTO `system_menu` VALUES (95, 68, '邀请二维码设置', 'layui-icon layui-icon-cols', 'data/config/cropper', 'data/config/cropper', '', '_self', 0, 1, '2021-03-01 09:53:59');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for system_oplog
|
||||
@ -4747,7 +4750,7 @@ CREATE TABLE `system_oplog` (
|
||||
`username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '操作人用户名',
|
||||
`create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统-日志' ROW_FORMAT = COMPACT;
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统-日志' ROW_FORMAT = COMPACT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of system_oplog
|
||||
@ -4763,6 +4766,10 @@ INSERT INTO `system_oplog` VALUES (8, 'admin/menu/edit', '127.0.0.1', '系统菜
|
||||
INSERT INTO `system_oplog` VALUES (9, 'admin/auth/add', '127.0.0.1', '系统权限管理', '添加系统权限[1]成功', 'admin', '2021-02-24 09:24:55');
|
||||
INSERT INTO `system_oplog` VALUES (10, 'admin/menu/edit', '127.0.0.1', '系统菜单管理', '修改系统菜单[94]成功', 'admin', '2021-02-24 09:32:05');
|
||||
INSERT INTO `system_oplog` VALUES (11, 'admin/menu/edit', '127.0.0.1', '系统菜单管理', '修改系统菜单[71]成功', 'admin', '2021-02-24 09:32:18');
|
||||
INSERT INTO `system_oplog` VALUES (12, 'admin/login/index', '127.0.0.1', '系统用户登录', '登录系统后台成功', 'admin', '2021-03-01 09:52:30');
|
||||
INSERT INTO `system_oplog` VALUES (13, 'admin/menu/add', '127.0.0.1', '系统菜单管理', '添加系统菜单[95]成功', 'admin', '2021-03-01 09:53:59');
|
||||
INSERT INTO `system_oplog` VALUES (14, 'admin/login/index', '127.0.0.1', '系统用户登录', '登录系统后台成功', 'admin', '2021-03-02 01:46:58');
|
||||
INSERT INTO `system_oplog` VALUES (15, 'admin/menu/edit', '127.0.0.1', '系统菜单管理', '修改系统菜单[95]成功', 'admin', '2021-03-02 08:22:53');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for system_queue
|
||||
@ -4829,7 +4836,7 @@ CREATE TABLE `system_user` (
|
||||
-- ----------------------------
|
||||
-- Records of system_user
|
||||
-- ----------------------------
|
||||
INSERT INTO `system_user` VALUES (10000, 'admin', '21232f297a57a5a743894a0e4a801fc3', '系统管理员', 'http://127.0.0.1:8000/upload/cf/d4b538dc1d8b96a09310cab5fa44c9.gif', ',,', '', '', '', '127.0.0.1', '2021-02-24 08:48:12', 78, '', 1, 0, 0, '2015-11-13 15:14:22');
|
||||
INSERT INTO `system_user` VALUES (10000, 'admin', '21232f297a57a5a743894a0e4a801fc3', '系统管理员', 'http://127.0.0.1:8000/upload/cf/d4b538dc1d8b96a09310cab5fa44c9.gif', ',,', '', '', '', '127.0.0.1', '2021-03-02 01:46:58', 80, '', 1, 0, 0, '2015-11-13 15:14:22');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for wechat_fans
|
||||
|
@ -33,7 +33,7 @@ class ShopOrderSend extends Controller
|
||||
$this->address = sysdata('ordersend');
|
||||
// 状态数据统计
|
||||
$this->total = ['t0' => 0, 't1' => 0, 't2' => 0, 'ta' => 0];
|
||||
$db = $this->app->db->name('ShopOrder')->whereIn('status', [3, 4, 5]);
|
||||
$db = $this->app->db->name('ShopOrder')->whereIn('status', [4, 5, 6]);
|
||||
$query = $this->app->db->name($this->table)->whereRaw("order_no in {$db->field('order_no')->buildSql()}");
|
||||
foreach ($query->fieldRaw('status,count(1) total')->group('status')->cursor() as $vo) {
|
||||
$this->total["t{$vo['status']}"] = $vo['total'];
|
||||
@ -47,7 +47,7 @@ class ShopOrderSend extends Controller
|
||||
$db = $this->_query('DataUser')->like('phone#user_phone,nickname#user_nickname')->db();
|
||||
if ($db->getOptions('where')) $query->whereRaw("uid in {$db->field('id')->buildSql()}");
|
||||
// 订单搜索查询
|
||||
$db = $this->_query('ShopOrder')->whereIn('status', [3, 4, 5])->db();
|
||||
$db = $this->_query('ShopOrder')->whereIn('status', [4, 5, 6])->db();
|
||||
if ($db->getOptions('where')) $query->whereRaw("order_no in {$db->field('order_no')->buildSql()}");
|
||||
// 列表选项卡状态
|
||||
if (is_numeric($this->type = trim(input('type', 'ta'), 't'))) {
|
||||
|
@ -269,14 +269,15 @@ class Order extends Auth
|
||||
public function payment()
|
||||
{
|
||||
$data = $this->_vali([
|
||||
'order_no.require' => '单号不能为空',
|
||||
'payment_code.require' => '参数不能为空',
|
||||
'payment_back.default' => '', # 支付回跳地址
|
||||
'order_no.require' => '单号不能为空',
|
||||
'payment_code.require' => '参数不能为空',
|
||||
'payment_back.default' => '', # 支付回跳地址
|
||||
'payment_image.default' => '', # 支付凭证地址
|
||||
]);
|
||||
$map = ['order_no' => $data['order_no']];
|
||||
$order = $this->app->db->name('ShopOrder')->where($map)->find();
|
||||
if (empty($order)) $this->error('读取订单失败');
|
||||
if ($order['status'] != 2) $this->error('不能发起支付');
|
||||
if (empty($order)) $this->error('读取订单异常');
|
||||
if ($order['status'] !== 2) $this->error('不能发起支付');
|
||||
if ($order['payment_status'] > 0) $this->error('已经完成支付');
|
||||
try {
|
||||
$openid = '';
|
||||
@ -286,7 +287,7 @@ class Order extends Auth
|
||||
}
|
||||
// 返回订单数据及支付发起参数
|
||||
$type = $order['amount_real'] <= 0 ? 'empty' : $data['payment_code'];
|
||||
$param = PaymentService::instance($type)->create($openid, $order['order_no'], $order['amount_real'], '商城订单支付', '', $data['payment_back']);
|
||||
$param = PaymentService::instance($type)->create($openid, $order['order_no'], $order['amount_real'], '商城订单支付', '', $data['payment_back'], $data['payment_image']);
|
||||
$order = $this->app->db->name('ShopOrder')->where($map)->find() ?: new \stdClass();
|
||||
$this->success('获取支付参数', ['order' => $order, 'param' => $param]);
|
||||
} catch (HttpResponseException $exception) {
|
||||
@ -310,7 +311,7 @@ class Order extends Auth
|
||||
]);
|
||||
$order = $this->app->db->name('ShopOrder')->where($map)->find();
|
||||
if (empty($order)) $this->error('读取订单失败');
|
||||
if (in_array($order['status'], [1, 2])) {
|
||||
if (in_array($order['status'], [1, 2, 3])) {
|
||||
$result = $this->app->db->name('ShopOrder')->where($map)->update([
|
||||
'status' => 0,
|
||||
'cancel_status' => 1,
|
||||
|
@ -256,12 +256,13 @@ abstract class PaymentService
|
||||
* @param string $paymentTrade 交易单号
|
||||
* @param string $paymentAmount 支付金额
|
||||
* @param string $paymentRemark 支付描述
|
||||
* @param string $paymentImage 支付凭证
|
||||
* @return boolean
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function updateOrder(string $orderNo, string $paymentTrade, string $paymentAmount, $paymentRemark = '在线支付'): bool
|
||||
public function updateOrder(string $orderNo, string $paymentTrade, string $paymentAmount, string $paymentRemark = '在线支付', string $paymentImage = ''): bool
|
||||
{
|
||||
$map = ['status' => 2, 'order_no' => $orderNo, 'payment_status' => 0];
|
||||
$order = $this->app->db->name('ShopOrder')->where($map)->find();
|
||||
@ -278,6 +279,7 @@ abstract class PaymentService
|
||||
'payment_type' => $this->type,
|
||||
'payment_code' => $this->code,
|
||||
'payment_trade' => $paymentTrade,
|
||||
'payment_image' => $paymentImage,
|
||||
'payment_amount' => $paymentAmount,
|
||||
'payment_remark' => $paymentRemark,
|
||||
'payment_status' => 1,
|
||||
@ -355,7 +357,8 @@ abstract class PaymentService
|
||||
* @param string $paymentTitle 交易订单名称
|
||||
* @param string $paymentRemark 交易订单描述
|
||||
* @param string $paymentReturn 支付回跳地址
|
||||
* @param string $paymentImage 支付凭证图片
|
||||
* @return array
|
||||
*/
|
||||
abstract public function create(string $openid, string $orderNo, string $paymentAmount, string $paymentTitle, string $paymentRemark, string $paymentReturn = ''): array;
|
||||
abstract public function create(string $openid, string $orderNo, string $paymentAmount, string $paymentTitle, string $paymentRemark, string $paymentReturn = '', string $paymentImage = ''): array;
|
||||
}
|
@ -66,10 +66,11 @@ class AlipayPaymentService extends PaymentService
|
||||
* @param string $paymentTitle 交易订单名称
|
||||
* @param string $paymentRemark 订单订单描述
|
||||
* @param string $paymentReturn 完成回跳地址
|
||||
* @param string $paymentImage 支付凭证图片
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
public function create(string $openid, string $orderNo, string $paymentAmount, string $paymentTitle, string $paymentRemark, string $paymentReturn = ''): array
|
||||
public function create(string $openid, string $orderNo, string $paymentAmount, string $paymentTitle, string $paymentRemark, string $paymentReturn = '', string $paymentImage = ''): array
|
||||
{
|
||||
try {
|
||||
if (isset(static::TYPES[$this->type])) {
|
||||
|
@ -34,20 +34,21 @@ class BalancePyamentService extends PaymentService
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建余额支付
|
||||
* @param string $openid
|
||||
* @param string $orderNo
|
||||
* @param string $paymentAmount
|
||||
* @param string $paymentTitle
|
||||
* @param string $paymentRemark
|
||||
* @param string $paymentReturn
|
||||
* 创建订单支付参数
|
||||
* @param string $openid 用户OPENID
|
||||
* @param string $orderNo 交易订单单号
|
||||
* @param string $paymentAmount 交易订单金额(元)
|
||||
* @param string $paymentTitle 交易订单名称
|
||||
* @param string $paymentRemark 订单订单描述
|
||||
* @param string $paymentReturn 完成回跳地址
|
||||
* @param string $paymentImage 支付凭证图片
|
||||
* @return array
|
||||
* @throws Exception
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function create(string $openid, string $orderNo, string $paymentAmount, string $paymentTitle, string $paymentRemark, string $paymentReturn = ''): array
|
||||
public function create(string $openid, string $orderNo, string $paymentAmount, string $paymentTitle, string $paymentRemark, string $paymentReturn = '', string $paymentImage = ''): array
|
||||
{
|
||||
$order = $this->app->db->name('ShopOrder')->where(['order_no' => $orderNo])->find();
|
||||
if (empty($order)) throw new Exception("订单不存在");
|
||||
|
@ -34,20 +34,21 @@ class EmptyPaymentService extends PaymentService
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建支付订单
|
||||
* 创建订单支付参数
|
||||
* @param string $openid 用户OPENID
|
||||
* @param string $orderNo 交易订单单号
|
||||
* @param string $paymentAmount 交易订单金额(元)
|
||||
* @param string $paymentTitle 交易订单名称
|
||||
* @param string $paymentRemark 交易订单描述
|
||||
* @param string $paymentReturn 支付回跳地址
|
||||
* @param string $paymentRemark 订单订单描述
|
||||
* @param string $paymentReturn 完成回跳地址
|
||||
* @param string $paymentImage 支付凭证图片
|
||||
* @return array
|
||||
* @throws Exception
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function create(string $openid, string $orderNo, string $paymentAmount, string $paymentTitle, string $paymentRemark, string $paymentReturn = ''): array
|
||||
public function create(string $openid, string $orderNo, string $paymentAmount, string $paymentTitle, string $paymentRemark, string $paymentReturn = '', string $paymentImage = ''): array
|
||||
{
|
||||
$order = $this->app->db->name('ShopOrder')->where(['order_no' => $orderNo])->find();
|
||||
if (empty($order)) throw new Exception("订单不存在");
|
||||
|
@ -63,11 +63,12 @@ class JoinpayPaymentService extends PaymentService
|
||||
* @param string $paymentAmount 交易订单金额(元)
|
||||
* @param string $paymentTitle 交易订单名称
|
||||
* @param string $paymentRemark 订单订单描述
|
||||
* @param string $paymentReturn 支付回跳地址
|
||||
* @param string $paymentReturn 完成回跳地址
|
||||
* @param string $paymentImage 支付凭证图片
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
public function create(string $openid, string $orderNo, string $paymentAmount, string $paymentTitle, string $paymentRemark, string $paymentReturn = ''): array
|
||||
public function create(string $openid, string $orderNo, string $paymentAmount, string $paymentTitle, string $paymentRemark, string $paymentReturn = '', string $paymentImage = ''): array
|
||||
{
|
||||
try {
|
||||
if (isset(static::TYPES[$this->type])) {
|
||||
|
@ -33,25 +33,27 @@ class VoucherPaymentService extends PaymentService
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $openid
|
||||
* @param string $orderNo
|
||||
* @param string $paymentAmount
|
||||
* @param string $paymentTitle
|
||||
* @param string $paymentRemark
|
||||
* @param string $paymentReturn
|
||||
* 创建订单支付参数
|
||||
* @param string $openid 用户OPENID
|
||||
* @param string $orderNo 交易订单单号
|
||||
* @param string $paymentAmount 交易订单金额(元)
|
||||
* @param string $paymentTitle 交易订单名称
|
||||
* @param string $paymentRemark 订单订单描述
|
||||
* @param string $paymentReturn 完成回跳地址
|
||||
* @param string $paymentImage 支付凭证图片
|
||||
* @return array
|
||||
* @throws Exception
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function create(string $openid, string $orderNo, string $paymentAmount, string $paymentTitle, string $paymentRemark, string $paymentReturn = ''): array
|
||||
public function create(string $openid, string $orderNo, string $paymentAmount, string $paymentTitle, string $paymentRemark, string $paymentReturn = '', string $paymentImage = ''): array
|
||||
{
|
||||
// @todo 支付凭证需要再处理下
|
||||
$order = $this->app->db->name('ShopOrder')->where(['order_no' => $orderNo])->find();
|
||||
if (empty($order)) throw new Exception("订单不存在");
|
||||
if ($order['status'] !== 2) throw new Exception("不可发起支付");
|
||||
$this->updateOrder($orderNo, CodeExtend::uniqidDate(20), $paymentAmount, '支付凭证');
|
||||
if (empty($paymentImage)) throw new Exception('支付凭证不能为空');
|
||||
$this->updateOrder($orderNo, CodeExtend::uniqidDate(20), $paymentAmount, '支付凭证', $paymentImage);
|
||||
return ['info' => '支付凭证上传成功!', 'status' => 1];
|
||||
}
|
||||
}
|
@ -35,17 +35,18 @@ class WechatPaymentService extends PaymentService
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建微信支付订单
|
||||
* 创建订单支付参数
|
||||
* @param string $openid 用户OPENID
|
||||
* @param string $orderNo 交易订单单号
|
||||
* @param string $paymentAmount 交易订单金额(元)
|
||||
* @param string $paymentTitle 交易订单名称
|
||||
* @param string $paymentRemark 订单订单描述
|
||||
* @param string $paymentReturn 支付回跳地址
|
||||
* @param string $paymentReturn 完成回跳地址
|
||||
* @param string $paymentImage 支付凭证图片
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
public function create(string $openid, string $orderNo, string $paymentAmount, string $paymentTitle, string $paymentRemark, string $paymentReturn = ''): array
|
||||
public function create(string $openid, string $orderNo, string $paymentAmount, string $paymentTitle, string $paymentRemark, string $paymentReturn = '', string $paymentImage = ''): array
|
||||
{
|
||||
try {
|
||||
if (isset(static::TYPES[$this->type])) {
|
||||
|
@ -9,7 +9,7 @@
|
||||
{block name="content"}
|
||||
<div class="layui-tab layui-tab-card table-block">
|
||||
<ul class="layui-tab-title notselect">
|
||||
{foreach ['ta'=>'全部订单','t2'=>'待支付的订单','t3'=>'待发货的订单','t4'=>'待收货的订单','t5'=>'已完成的订单','t0'=>'已取消的订单'] as $k=>$v}
|
||||
{foreach ['ta'=>'全部订单','t2'=>'待支付的订单','t3'=>'待审核的订单','t4'=>'待发货的订单','t5'=>'待收货的订单','t6'=>'已完成的订单','t0'=>'已取消的订单'] as $k=>$v}
|
||||
{if isset($type) and 't'.$type eq $k}
|
||||
<li data-open="{:url('index')}?type={$k}" class="layui-this">{$v}<sup class="layui-badge border-radius">{$total[$k]??0}</sup></li>
|
||||
{else}
|
||||
@ -57,13 +57,14 @@
|
||||
<td class='nowrap'>
|
||||
{eq name='vo.status' value='0'}<span class="layui-badge layui-badge-middle layui-bg-gray" data-tips-text="{$vo.cancel_remark}">已取消</span>{/eq}
|
||||
{eq name='vo.status' value='1'}<span class="layui-badge layui-badge-middle layui-bg-red">预订单</span>{/eq}
|
||||
{eq name='vo.status' value='2'}<span class="layui-badge layui-badge-middle layui-bg-orange">待付款</span>{/eq}
|
||||
{eq name='vo.status' value='3'}<span class="layui-badge layui-badge-middle layui-bg-black">待发货</span>{/eq}
|
||||
{eq name='vo.status' value='4'}<span class="layui-badge layui-badge-middle layui-bg-green">已发货</span>{/eq}
|
||||
{eq name='vo.status' value='5'}<span class="layui-badge layui-badge-middle layui-bg-blue">已完成</span>{/eq}
|
||||
{eq name='vo.status' value='2'}<span class="layui-badge layui-badge-middle layui-bg-red">待付款</span>{/eq}
|
||||
{eq name='vo.status' value='3'}<span class="layui-badge layui-badge-middle layui-bg-orange">待审核</span>{/eq}
|
||||
{eq name='vo.status' value='4'}<span class="layui-badge layui-badge-middle layui-bg-black">待发货</span>{/eq}
|
||||
{eq name='vo.status' value='5'}<span class="layui-badge layui-badge-middle layui-bg-green">已发货</span>{/eq}
|
||||
{eq name='vo.status' value='6'}<span class="layui-badge layui-badge-middle layui-bg-blue">已完成</span>{/eq}
|
||||
<div class="inline-block text-middle">
|
||||
订单单号:<span class="color-blue">{$vo.order_no|default=''}</span><br>
|
||||
订单总计 <b class="color-blue">{$vo.amount_total+0}</b> 元<span class="color-blue">{if $vo.amount_express>0}(含邮费{$vo.amount_express+0}元){else}(包邮){/if}</span>已支付 <b class="color-blue">{$vo.payment_amount+0}</b> 元<br>
|
||||
订单单号:<b class="color-blue">{$vo.order_no|default=''}</b><br>
|
||||
订单总计:<b class="color-blue">{$vo.amount_total+0}</b> 元<span class="color-blue">{if $vo.amount_express>0}(含邮费{$vo.amount_express+0}元){else}(包邮){/if}</span>已支付 <b class="color-blue">{$vo.payment_amount+0}</b> 元<br>
|
||||
下单时间:{$vo.create_at|format_datetime}<br>
|
||||
<!--{notempty name='vo.payment_status'}-->
|
||||
支付时间:{$vo.payment_datetime|format_datetime} {notempty name='vo.payment_name'}<span class="color-blue"> ({$vo.payment_name|default='-'})</span>{/notempty}<br>
|
||||
|
Loading…
x
Reference in New Issue
Block a user