<?php

namespace App\Http\Controllers\PartnerPay;

use App\Http\Controllers\Controller;
use App\Http\Controllers\Core\Auth;
use App\Services\Pay\FlowerService;
use Illuminate\Http\Request;

class FlowerController extends Controller
{
    /**
     * 通过小花提升人气值时长
     */
    public function payPopularity()
    {
        $uid = Auth::auth();
        $fs = new FlowerService();
        $fs->payPopularity($uid);
        return array(
            'code' => 200,
            'message' => 'success'
        );
    }

    /**
     * 用户小花明细
     * @param  Request  $request
     * @return array
     */
    public function flowerlogs(Request $request)
    {

        $uid = Auth::auth();
        $page = $request->get('page') ?? 1;
        $pages = array(
            'page' => $page,
            'limit' => 30
        );
        $fs = new FlowerService();
        $data = $fs->logs($uid, $pages);
        return array(
            'code' => 200,
            'message' => 'success',
            'data' => $data
        );
    }
}
