草庐IT

attendances

全部标签

php - "Type error: Too few arguments to function App\Http\Controllers\UserController::attendance(), 0 passed and exactly 1 expected"

我的数据库中有两个表,分别是用户表和出勤表。我现在想做的是根据用户在与他们的个人资料相关联的出勤View中显示数据库中的出勤数据。这是我在userController中的考勤功能。publicfunctionattendance($id){$user=UserProfile::findOrFail($id);$this->authorize('modifyUser',$user);returnview('user.attendance',['user'=>$user]);}这是我到出勤View的路径。Route::get('/attendance/',['as'=>'user.atte

node.js - 基于具有值的动态日期键的 Mongoose 过滤器

我创建了一个员工出勤应用程序,其中记录出勤情况并将其存储在数据库中。我试图获取所有值为"Present"的日期字段的计数。数据像这样存储在数据库中:"attendances":{:"value"}pair//Thevaluesbeing"Absent"or"Present"whateverthecasemaybe.问题是,每当我尝试用"attendances":{"2019-08-28":"Present"}。谁能帮我找出哪里做错了?//架构constSchema=mongoose.Schema;constemployeeSchema=newSchema({name:String,de