@if($set->drivertype ==1) <input type="text" name="datatype" value="{{$set->datatype}}"> @else <select name="datatype"> <option value="0">MIN</option> <option value="1" @if($set->datatype ==1) selected @endif >MAX</option> </select> @endif </span> <input type="hidden" name="requests" value="<?php $val = ","; DB::select("select * from runners where deleted_at is null and state=''"); foreach (App\Runner::where("setid", "=", $set->id)->where("state", "=", "static")->get() as $runner) { $val = $val . $runner->requestid . ","; } echo $val; ?> "> </form> <br/> <ol> <!--动态添加请求--> @foreach(App\Runner::where("runners.setid","=",$set->id)->where("runners.state","=","static")->get() as $runner) <li><a href='#' target='_self' name="{{$runner->requestid}}">{{App\InterRequest::find($runner->requestid)->name}}  {{App\Field::where("requestid","=",$runner->requestid)->count()}} </a></li> @endforeach </ol>
function checkRunnerDoc($race, $doc_num) { $runner = App\Runner::where(['race_id' => $race->id, 'doc_num' => $doc_num, 'status' => 1])->first(); if (!is_null($runner)) { return 'Lo sentimos, el numero de documento ' . $doc_num . ' ya cuenta con un registro en el evento.'; } return false; }