|
|
@@ -6,6 +6,7 @@ namespace app\api\controller;
|
|
|
use app\BaseController;
|
|
|
use app\model\api\ChatBalanceLog;
|
|
|
use app\model\api\ChatOrder;
|
|
|
+use app\model\api\User as UserModel;
|
|
|
use app\Request;
|
|
|
use app\services\chat\ChatBalanceService;
|
|
|
|
|
|
@@ -49,7 +50,7 @@ class ChatBuy extends BaseController
|
|
|
$totalPrice = $price * $chatNum;
|
|
|
|
|
|
// 检查用户积分是否足够
|
|
|
- $userScore = \app\model\api\UserScoreDetail::getUserScore($userId);
|
|
|
+ $userScore = (float)(new UserModel)->where('uid', $userId)->value('score');
|
|
|
if ($userScore < $totalPrice) {
|
|
|
return app('json')->fail('积分不足,当前积分:' . $userScore);
|
|
|
}
|