<?php
/**
 * Created by PhpStorm.
 * User: bmb369
 * Date: 2024-05-07
 * Time: 14:20
 */
namespace App\Models;

use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\DB;
// use App\Lib\JwtService;

class AddrModel extends Base {

    protected $table = 'yh_addr';
     use SoftDeletes;

//     protected $dates = ['deleted_at'];
    protected $primaryKey = 'id';


     public function selectUserAddrinfo(array $where, $field = ["*"])
     {
         return AddrModel::where($where)->orderBy('def_add', 'DESC')->orderBy('id', 'asc')->get($field)->toArray();
     }

     public function findUserAddrinfo(array $where, $field = ["*"])
     {
         return AddrModel::where($where)->get($field)->first();
     }


//     public function insertAddrInfo($data = [])
//     {
//         return DB::table($this->table)->insertGetId($data);
//     }

//     public function getInfo($where = [],$field = []){
// //         $this->selectDataWithField($where,$field);
//         AddrModel::where($where)->field($field)->->orderBy('id', 'desc');
//     }
    

}