mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-12-01 22:50:44 +00:00
feat: #10000 店铺授权过期状态更新
This commit is contained in:
parent
60eaa6cb73
commit
b378e2fbb8
@ -19,11 +19,15 @@ class ShopsController extends Controller
|
||||
public function index(Request $request)
|
||||
{
|
||||
$shops = Shop::query()->filter()->paginate($request->get('per_page'));
|
||||
$time = time();
|
||||
foreach ($shops as $shop) {
|
||||
$shop->authUrl = '';
|
||||
if ('妙选' !== $shop->plat_id && ('未授权' === $shop->status || '重新授权' === $shop->status)) {
|
||||
$shop->authUrl = BusinessFactory::init()->make($shop->plat_id)->getAuthUrl($shop->id, $shop->getOriginal('plat_id'));
|
||||
}
|
||||
if ($shop->expires_at && $time >= $shop->expires_at) {
|
||||
Shop::query()->where('id', $shop->id)->update(['status' => Shop::$STATUS_UNAUTHORIZED]);
|
||||
}
|
||||
}
|
||||
|
||||
return ShopsResource::collection($shops);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user