<?php
namespace app\app\logic;

use app\index\model\appointmentmodel;

/**
 * 登记记录表
 *
 * @author wj
 * @date 2022-07-22
 */
class appointmentlogic extends baselogic
{
    /**
     * 设置请求数据规则
     * 20220107
     * wj
     */
    protected function setrules()
    {
        $list = [
            'getlastinfo' => [
                ['name' => 'code', 'title' => '申请编码', 'require' => true, 'type' => 'string'],
            ],
            /*'saveinfo' => [
        ['name' => 'openid', 'title' => 'openid', 'require' => true, 'type' => 'string'],
        ['name' => 'union_id', 'title' => 'union_id', 'require' => false, 'type' => 'string'],
        ['name' => 'nick_name', 'title' => '昵称', 'require' => true, 'type' => 'string'],
        ['name' => 'avatar_url', 'title' => '头像', 'require' => false, 'type' => 'string'],
        ['name' => 'gender', 'title' => '性别', 'require' => false, 'type' => 'string'],
        ['name' => 'province', 'title' => '省', 'require' => false, 'type' => 'string'],
        ['name' => 'city', 'title' => '市', 'require' => false, 'type' => 'string'],
        ['name' => 'country', 'title' => '县', 'require' => false, 'type' => 'string'],
        ['name' => 'tel', 'title' => '手机号', 'require' => false, 'type' => 'string'],
        ['name' => 'address', 'title' => '地址', 'require' => false, 'type' => 'string'],
        ],*/
        ];
        return $list;
    }
    /**
     * 获取用户当日申请最后一条数据
     *
     * @param  [type] $arr
     * @return void
     * @author wj
     * @date 2022-07-22
     */
    public function getlastinfo($arr)
    {
        $m_a = new appointmentmodel();
        $info = $m_a->getlastinfo($arr);
        if (empty($info)) {
            return backarr(0, "无申请数据");
        }
        return backarr(1, "查询成功", $info);
    }
}
