<?php

namespace app\controller\admin\xm;

use app\BaseController;
use app\service\CurdService;
use think\response\Json;

class MemberController extends BaseController
{

    public function page(): Json
    {
        try{
            $model = \app\entity\XmMember::withSearch([], [
                'telephone'            => $this->request->get('telephone/s', ''),
                'telephone_md5'        => $this->request->get('telephone_md5/s', ''),
                'realname'             => $this->request->get('realname/s', ''),
                'register_channel_id ' => $this->request->get('register_channel_id/d', 0),
            ])->append(['channel']);

            $paginate = CurdService::getPaginate($this->request, $model);
        }catch (\Exception $e){
            return  $this->writeError($e->getMessage());
        }


        return $this->writeSuccess('success', $paginate);
    }
}