海工商新版后台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

32 lines
807 B

<?php
namespace App\Services;
use App\Models\AdmissionNewStudents;
class PublicServices extends BaseServices
{
/**
* 返回指定身份证学生新老生身份
* @param $idcard
* @return \Illuminate\Database\Eloquent\HigherOrderBuilderProxy|mixed
*/
public function checkIsNewOldStudent($idcard)
{
$count = AdmissionNewStudents::query()->where([
"idCard" => $idcard
])->count();
//出现两条数据以上时必为老生
if($count > 1){
return AdmissionNewStudents::IS_NEW_STUDENT_NO;
}
//为一条数据时检测是否为老生
$studentInfo = AdmissionNewStudents::query()->where([
"idCard" => $idcard
])->first();
return $studentInfo->is_new_student;
}
}