feat: 新增采购款支付功能

This commit is contained in:
mkm 2024-07-01 16:33:14 +08:00
parent 9b2bdc2c4f
commit f1f609563a
4 changed files with 13 additions and 3 deletions

View File

@ -249,6 +249,10 @@ class OrderController extends BaseApiController
}
switch ($pay_type) {
case PayEnum::PURCHASE_FUNDS:
//采购款支付
PayNotifyLogic::handle('purchase_funds', $order['order_id']);
return $this->success('采购款支付成功');
case PayEnum::BALANCE_PAY:
//余额支付
PayNotifyLogic::handle('balancePay', $order['order_id']);

View File

@ -61,7 +61,6 @@ class OrderLogic extends BaseLogic
*/
static public function cartIdByOrderInfo($cartId, $addressId, $user = null, $params = [])
{
$where = ['is_pay' => 0];
$cart_select = Cart::whereIn('id', $cartId)->where($where)->field('id,product_id,cart_num')->select()->toArray();
if (empty($cart_select)) {
@ -174,7 +173,7 @@ class OrderLogic extends BaseLogic
}
//处理返回最近的店铺
$store['near_store'] = [];
if ((isset($params['lat']) && $params['lat'] != '') && (isset($params['long']) && $params['lat'] != '')) {
if ((isset($params['lat']) && $params['lat'] != '') && (isset($params['long']) && $params['long'] != '')) {
$storeAll = SystemStore::field('id,name,phone,address,detailed_address,latitude,longitude')->select()->toArray();
$nearestStore = null;
$minDistance = PHP_FLOAT_MAX;

View File

@ -1227,7 +1227,11 @@ class PayNotifyLogic extends BaseLogic
*/
public static function dealGoodsLeft($cart_id,$uid,$oid)
{
$cart_id['cart_id'] = explode(',',$cart_id);
if(is_array($cart_id)){
$cart_id['cart_id'] = $cart_id;
}else{
$cart_id['cart_id'] = explode(',',$cart_id);
}
$data = OrderLogic::checkLeft($cart_id,$uid,1);
$format = $data['detail'];
foreach ($format as &$value){

View File

@ -8,6 +8,7 @@ use app\common\enum\PayEnum;
use app\common\model\user\UserAuth;
use app\common\service\pay\PayService;
use Exception;
use support\Log;
use function DI\string;
@ -101,6 +102,8 @@ class PaymentLogic extends BaseLogic
try {
$result = $wechat->wechat->pos($order)->toArray();
} catch (Exception $e) {
Log::error('条码支付报错',['message' => $e->extra['message']?? $e->getMessage(),'code'=>$e->getCode()]);
if (getenv('APP_DEBUG') == true) {
self::$error = $e->extra['message'] ?? $e->getMessage();
} else {