feature/main20240421
lqmac 6 months ago
parent 8f78dee6cc
commit 3f25450980
  1. 2
      app/command/ProfitSharing.php
  2. 18
      app/command/ProfitSharingResult.php
  3. 2
      app/common/library/payment/gateway/driver/wechat/V3.php
  4. 2
      app/store/model/store/Role.php
  5. 4
      app/store/model/store/RoleMenu.php
  6. 2
      config/database.php

@ -167,7 +167,7 @@ class ProfitSharing extends Command
$ret = $payment->addReceiver("MERCHANT_ID", $platform_wechat_config['mchId'], "武汉市汉阳区静好电子商务商行(个体工商户)", "HEADQUARTER");
//exit();
$transaction_id = $payment_trade->trade_no;
$out_trade_no = "PS".date("YmdHis").mt_rand(1000,9999);
$out_trade_no = "ps".date("YmdHis").mt_rand(1000,9999);
$receivers = [
[
"type" => "MERCHANT_ID",

@ -92,10 +92,12 @@ class ProfitSharingResult extends Command
//支付信息初始化
$PaymentModel = new Payment;
$templateInfo = $PaymentModel->getPaymentInfo(PaymentMethodEnum::WECHAT, ClientEnum::MP_WEIXIN, $order->store_id, $order->merchant_id);
$options = $templateInfo['template']['config'][PaymentMethodEnum::WECHAT];
$payment = PaymentFacade::store(PaymentMethodEnum::WECHAT)->setOptions($options, ClientEnum::MP_WEIXIN);
// var_dump($payment);
// exit();
$payment_trade = PaymentTrade::where('trade_id', $order->trade_id)->field('trade_no')->find();
if (!$payment_trade) {
@ -105,12 +107,14 @@ class ProfitSharingResult extends Command
$transaction_id = $payment_trade->trade_no;
$sharing = $payment->profitsharingQuery($order->out_order_no, $transaction_id);
var_dump($sharing);
var_dump($sharing->return_code);
var_dump($sharing->result_code);
//更新
$ret = Order::where('order_id',$order->order_id)->update(['profitsharing_status' => 2, 'profitsharing_time' => time()]);
echo "微信支付分账结果".PHP_EOL;
var_dump($ret);
if ($sharing['state'] == "FINISHED") {
//更新
$ret = Order::where('order_id',$order->order_id)->update(['profitsharing_status' => 2, 'profitsharing_time' => time()]);
echo "微信支付分账结果".PHP_EOL;
var_dump($ret);
}
} catch (\Exception $e) {
echo $e->getMessage();
continue;

@ -169,9 +169,7 @@ class V3
{
// 下单的参数
$params = ['transaction_id' => $transaction_id];
var_dump($params);
$url = $this->getProfitUrl()."/".$out_order_no."?transaction_id=".$transaction_id;
echo $url;
try {
$resp = $this->getApp()
->chain($url)

@ -108,7 +108,7 @@ class Role extends RoleModel
$this->save($data);
// 新增角色菜单关系记录
RoleMenuModel::increased((int)$this['role_id'], $data['menus']);
RoleMenuModel::increased((int)$this['role_id'], $data['menus'], $data['store_id']);
});
return true;
}

@ -27,14 +27,14 @@ class RoleMenu extends RoleMenuModel
* @param array $menuIds
* @return array|false
*/
public static function increased(int $roleId, array $menuIds)
public static function increased(int $roleId, array $menuIds, int $storeId = 0)
{
$data = [];
foreach ($menuIds as $menuId) {
$data[] = [
'role_id' => $roleId,
'menu_id' => $menuId,
'store_id' => self::$storeId,
'store_id' => $storeId ? $storeId : self::$storeId,
];
}
return (new static)->addAll($data);

@ -49,7 +49,7 @@ return [
// 数据库连接参数
'params' => [],
// 数据库编码默认采用utf8
'charset' => env('database.charset', 'utf8'),
'charset' => env('database.charset', 'utf8mb4'),
// 数据库表前缀
'prefix' => env('database.prefix', 'yoshop_'),

Loading…
Cancel
Save