我的模特
class Applicant extends Model {
protected $dates = [ 'date_of_birth', 'sent_by_post_date' ];
protected $table = 'applicants';
protected $casts = [ 'application_no' => 'object' ];
}
存储在application_no
中的记录,密钥可能会增加... [A,B,C,D,.....]
1. {
"A" : 1,
"C" : 1,
}
2. {
"A" : 2,
"B" : 1,
}
3. {
"A" : 3,
"B" : 2,
}
4. {
"A" : 4,
"B" : 3,
}
5. {
"A" : 5,
"C" : 2,
"D" : 1,
}
现在我希望得到A
或B
的最大application_no .....明智......
public function getMaximumApplicationNo($shortCode){
return Applicant::max("application_no.$shortCode" );
}