wang hou sheng 7 months ago
parent 399efe9be3
commit 71a381a882
  1. 4
      app/api/model/user/IdentityOrder.php
  2. 16
      app/api/service/Goods.php
  3. 4
      app/api/service/Notify.php
  4. 2
      app/api/service/identity/Payment.php

@ -29,11 +29,12 @@ class IdentityOrder extends BaseIdentityOrder
/**
* @notes:创建订单
* @param array $identityInfo
* @param $method
* @return bool
* @throws BaseException
* @author: wanghousheng
*/
public function createOrder(array $identityInfo): bool
public function createOrder(array $identityInfo, $method): bool
{
$data = [
'user_id' => UserService::getCurrentLoginUserId(),
@ -43,6 +44,7 @@ class IdentityOrder extends BaseIdentityOrder
'pay_price' => $identityInfo['price'],
'month' => $identityInfo['month'],
'platform' => getPlatform(),
'pay_method' => $method,
'store_id' => self::$storeId,
];
return $this->save($data);

@ -174,24 +174,12 @@ class Goods extends GoodsService
public function brandList($storeid)
{
$model = new GoodsModel;
$goodsList = $model->getList([
'status' => 10,
'is_delete' => 0,
'is_brand' => $_GET['is_brand'],
'is_new' => $_GET['is_new'],
'is_in_store' => $_GET['is_in_store'] ?? '',//是否店内
'store_id' => $storeid,
'categoryId' => (int)$_GET['categoryId'],
], 15);
$parmas = $this->request->get();
$goodsList = $model->getList($parmas);
if (empty($goodsList) && $goodsList->isEmpty()) {
return [];
}
$list = $goodsList->toArray();
// echo "<pre>";
// print_r($list);
// exit()
$list['data'] = $this->newFormatGoodsList($list['data']);
return $list;

@ -26,6 +26,7 @@ use app\common\library\payment\Facade as PaymentFacade;
use app\common\library\payment\gateway\Driver;
use app\common\library\payment\gateway\driver\wechat\V3 as WechatPaymentV3;
use cores\exception\BaseException;
use think\facade\Db;
/**
* 服务类:第三方支付异步通知
@ -67,6 +68,7 @@ class Notify
*/
public function wechatV3(): string
{
Db::table('yoshop_wx_server')->insertGetId(['content' => '进入v3', 'created_at' => date('Y-m-d H:i:s')]);
try {
// 通过微信支付v3平台证书序号 获取支付模板
$wechatpaySerial = \request()->header('wechatpay-serial');
@ -131,6 +133,7 @@ class Notify
*/
private function orderPaySucces(PaymentTradeModel $tradeInfo, array $paymentData)
{
Db::table('yoshop_wx_server')->insertGetId(['content' => '第一步', 'created_at' => date('Y-m-d H:i:s')]);
// 记录日志
Log::append('Notify-orderPaySucces', [
'orderType' => OrderTypeEnum::data()[$tradeInfo['order_type']]['name'],
@ -166,6 +169,7 @@ class Notify
}
// 订单支付成功业务处理 (开通会员、分销商)
if ($tradeInfo['order_type'] == OrderTypeEnum::MEMBER || $tradeInfo['order_type'] == OrderTypeEnum::DEALER) {
Db::table('yoshop_wx_server')->insertGetId(['content' => '进入异步通知开始处理会员分销业务', 'created_at' => date('Y-m-d H:i:s')]);
$service = new identity\PaySuccess();
$service->setOrderNo($tradeInfo['order_no'])
->setMethod($tradeInfo['pay_method'])

@ -166,7 +166,7 @@ class Payment extends BaseService
if (UserService::isDealerMember() && $info['type'] != IdentityEnum::DEALER) {
throwError('非法操作');
}
if (!$model->createOrder($info->toArray())) {
if (!$model->createOrder($info->toArray(), $this->method)) {
throwError($model->getError() ?: '创建订单失败');
}
$model['order_id'] = (int)$model['order_id'];

Loading…
Cancel
Save