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

@ -174,24 +174,12 @@ class Goods extends GoodsService
public function brandList($storeid) public function brandList($storeid)
{ {
$model = new GoodsModel; $model = new GoodsModel;
$parmas = $this->request->get();
$goodsList = $model->getList([ $goodsList = $model->getList($parmas);
'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);
if (empty($goodsList) && $goodsList->isEmpty()) { if (empty($goodsList) && $goodsList->isEmpty()) {
return []; return [];
} }
$list = $goodsList->toArray(); $list = $goodsList->toArray();
// echo "<pre>";
// print_r($list);
// exit()
$list['data'] = $this->newFormatGoodsList($list['data']); $list['data'] = $this->newFormatGoodsList($list['data']);
return $list; 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;
use app\common\library\payment\gateway\driver\wechat\V3 as WechatPaymentV3; use app\common\library\payment\gateway\driver\wechat\V3 as WechatPaymentV3;
use cores\exception\BaseException; use cores\exception\BaseException;
use think\facade\Db;
/** /**
* 服务类:第三方支付异步通知 * 服务类:第三方支付异步通知
@ -67,6 +68,7 @@ class Notify
*/ */
public function wechatV3(): string public function wechatV3(): string
{ {
Db::table('yoshop_wx_server')->insertGetId(['content' => '进入v3', 'created_at' => date('Y-m-d H:i:s')]);
try { try {
// 通过微信支付v3平台证书序号 获取支付模板 // 通过微信支付v3平台证书序号 获取支付模板
$wechatpaySerial = \request()->header('wechatpay-serial'); $wechatpaySerial = \request()->header('wechatpay-serial');
@ -131,6 +133,7 @@ class Notify
*/ */
private function orderPaySucces(PaymentTradeModel $tradeInfo, array $paymentData) 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', [ Log::append('Notify-orderPaySucces', [
'orderType' => OrderTypeEnum::data()[$tradeInfo['order_type']]['name'], 'orderType' => OrderTypeEnum::data()[$tradeInfo['order_type']]['name'],
@ -166,6 +169,7 @@ class Notify
} }
// 订单支付成功业务处理 (开通会员、分销商) // 订单支付成功业务处理 (开通会员、分销商)
if ($tradeInfo['order_type'] == OrderTypeEnum::MEMBER || $tradeInfo['order_type'] == OrderTypeEnum::DEALER) { 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 = new identity\PaySuccess();
$service->setOrderNo($tradeInfo['order_no']) $service->setOrderNo($tradeInfo['order_no'])
->setMethod($tradeInfo['pay_method']) ->setMethod($tradeInfo['pay_method'])

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

Loading…
Cancel
Save