<?php


namespace Heanup\App\Api\Controller;


use Heanup\App\Api\Controller;
use Heanup\App\Api\Package\Database\Num;
use Heanup\Library\Pager;
use Heanup\Library\Sms\ReceiveSmsFree;

class Index extends Controller
{
    protected function main()
    {
        $country=$this->getQuery()->string("country");
        if ($country){
            $where=['country'=>$country];
        }else{
            $where=[];
        }
        $page = $this->getQuery()->intval("page", 1);
        $pgSize = 20;
//        $country="+86";
//        $phone_num="17771934420";
//        $data = $lib->getMessage($country, $phone_num);
//        $data=$lib->getCountry();
        $this->_data = Num::getPageList($where, "", $page, $pgSize, ['id' => true]);
        $this->pager = Pager::pager($this->_data['total_count'], $pgSize, "/?".http_build_query($_GET), $page);
        $this->render();
//        $this->showSuccess($this->data);
    }
}