Merge remote-tracking branch 'origin/main'

main
limu 10 months ago
commit a407821176
  1. 5
      app/common/model/user/User.php
  2. 8
      app/controller/api/Auth.php
  3. 1
      runtime/swoole.pid

@ -328,4 +328,9 @@ class User extends BaseModel
}
}
public static function SumBrokeragePrice(int $status = 1): float
{
return self::getDB()->where("status", $status)->sum("brokerage_price") ?? 0.00;
}
}

@ -15,6 +15,7 @@ namespace app\controller\api;
use app\common\dao\store\order\StoreOrderDao;
use app\common\model\user\User;
use app\common\repositories\store\order\StoreOrderRepository;
use app\common\repositories\store\order\StoreRefundOrderRepository;
use app\common\repositories\system\notice\SystemNoticeConfigRepository;
@ -158,6 +159,13 @@ class Auth extends BaseController
$data = $user->toArray();
$data['total_consume'] = $user['pay_price'];
$data['extension_status'] = systemConfig('extension_status');
$brokeragePrice = User::SumBrokeragePrice();
if($brokeragePrice > 0) {
$data['point_price'] = bcdiv(systemConfig('all_award'), $brokeragePrice, 2);
}
$data['asset_price'] = bcmul($data['point_price'], $this->request->userInfo()->brokerage_price ?? 0,2);
if (systemConfig('member_status'))
$data['member_icon'] = $this->request->userInfo()->member->brokerage_icon ?? '';
if ($data['is_svip'] == 3)

Loading…
Cancel
Save