Commit ef9842cd by 杨树贤

添加最新获取的10条邀请记录

parent a0def9d5
Showing with 13 additions and 0 deletions
......@@ -7,6 +7,7 @@ namespace App\Http\Controllers;
use App\Services\InviteService;
use App\Services\OfferService;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
class InvitesController extends Controller
{
......@@ -56,6 +57,18 @@ class InvitesController extends Controller
{
$userId = $request->user->user_id;
$result = $this->service->getInviteInfo(['user_id' => $userId]);
//还要获取最新的10条邀请记录,走缓存
$newInvites = Cache::remember('recent_invites', 10, function () {
return $this->service->getInviteList([]);
});
$newInvites = array_get($newInvites, 'data');
$newInvites = array_map(function ($value) {
$value['invited_user_mobile'] = substr_replace($value['invited_user_mobile'],
'****', 4, 4);
return $value;
}, $newInvites);
$result['data']['recent_invites'] = $newInvites;
return $this->Export(0, 'ok', $result);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment