diff --git a/admin/src/app/api/physical_test.ts b/admin/src/app/api/physical_test.ts index e76fba51..c3b59a5d 100644 --- a/admin/src/app/api/physical_test.ts +++ b/admin/src/app/api/physical_test.ts @@ -1,5 +1,11 @@ import request from '@/utils/request' + + + + + + // USER_CODE_BEGIN -- physical_test /** * 获取体测列表 @@ -7,7 +13,7 @@ import request from '@/utils/request' * @returns */ export function getPhysicalTestList(params: Record) { - return request.get(`physical_test/physical_test`, { params }) + return request.get(`physical_test/physical_test`, {params}) } /** @@ -16,7 +22,7 @@ export function getPhysicalTestList(params: Record) { * @returns */ export function getPhysicalTestInfo(id: number) { - return request.get(`physical_test/physical_test/${id}`) + return request.get(`physical_test/physical_test/${id}`); } /** @@ -25,10 +31,7 @@ export function getPhysicalTestInfo(id: number) { * @returns */ export function addPhysicalTest(params: Record) { - return request.post('physical_test/physical_test', params, { - showErrorMessage: true, - showSuccessMessage: true, - }) + return request.post('physical_test/physical_test', params, { showErrorMessage: true, showSuccessMessage: true }) } /** @@ -38,10 +41,7 @@ export function addPhysicalTest(params: Record) { * @returns */ export function editPhysicalTest(params: Record) { - return request.put(`physical_test/physical_test/${params.id}`, params, { - showErrorMessage: true, - showSuccessMessage: true, - }) + return request.put(`physical_test/physical_test/${params.id}`, params, { showErrorMessage: true, showSuccessMessage: true }) } /** @@ -50,10 +50,15 @@ export function editPhysicalTest(params: Record) { * @returns */ export function deletePhysicalTest(id: number) { - return request.delete(`physical_test/physical_test/${id}`, { - showErrorMessage: true, - showSuccessMessage: true, - }) + return request.delete(`physical_test/physical_test/${id}`, { showErrorMessage: true, showSuccessMessage: true }) +} + +export function getWithCustomerResourcesList(params: Record){ + return request.get('physical_test/customer_resources_all', {params}) +}export function getWithStudentList(params: Record){ + return request.get('physical_test/student_all', {params}) +}export function getWithPersonnelList(params: Record){ + return request.get('physical_test/personnel_all', {params}) } // USER_CODE_END -- physical_test diff --git a/admin/src/app/lang/zh-cn/customer_resources.customer_resources.json b/admin/src/app/lang/zh-cn/customer_resources.customer_resources.json index 31b75bc5..429f9055 100644 --- a/admin/src/app/lang/zh-cn/customer_resources.customer_resources.json +++ b/admin/src/app/lang/zh-cn/customer_resources.customer_resources.json @@ -52,5 +52,56 @@ "staffId":"人员", "paymentTime":"支付时间", "addOrderTable":"添加订单", - "updateOrderTable":"编辑订单" + "updateOrderTable":"编辑订单", + + + "resourceId":"客户姓名", + "resourceIdPlaceholder":"全部", + "studentId":"学员姓名", + "studentIdPlaceholder":"全部", + "height":"身高", + "heightPlaceholder":"请输入身高", + "createdAt":"创建时间", + "updatedAt":"修改时间", + "addPhysicalTest":"添加体测", + "updatePhysicalTest":"编辑体测", + "physicalTestDeleteTips":"确定要删除该数据吗?", + "startDate":"请选择开始时间", + "endDate":"请选择结束时间", + + "resourceId":"客户姓名", + "resourceIdPlaceholder":"全部", + "studentId":"学员姓名", + "studentIdPlaceholder":"全部", + "height":"身高", + "heightPlaceholder":"请输入身高", + "weight":"体重", + "weightPlaceholder":"请输入体重", + "coachId":"教练", + "coachIdPlaceholder":"请输入教练", + "seatedForwardBend":"坐位体前屈", + "seatedForwardBendPlaceholder":"请输入坐位体前屈", + "sitUps":"仰卧卷腹", + "sitUpsPlaceholder":"请输入仰卧卷腹", + "pushUps":"九十度仰卧撑", + "pushUpsPlaceholder":"请输入九十度仰卧撑", + "flamingoBalance":"火烈鸟平衡测试", + "flamingoBalancePlaceholder":"请输入火烈鸟平衡测试", + "thirtySecJump":"三十秒双脚连续跳", + "thirtySecJumpPlaceholder":"请输入三十秒双脚连续跳", + "standingLongJump":"立定跳远", + "standingLongJumpPlaceholder":"请输入立定跳远", + "agilityRun":"4乘10m灵敏折返跑", + "agilityRunPlaceholder":"请输入4乘10m灵敏折返跑", + "balanceBeam":"走平衡木", + "balanceBeamPlaceholder":"请输入走平衡木", + "tennisThrow":"网球掷远", + "tennisThrowPlaceholder":"请输入网球掷远", + "tenMeterShuttleRun":"十米往返跑", + "tenMeterShuttleRunPlaceholder":"请输入十米往返跑", + "addPhysicalTest":"添加体测", + "updatePhysicalTest":"编辑体测", + "physicalTestDeleteTips":"确定要删除该数据吗?", + "startDate":"请选择开始时间", + "endDate":"请选择结束时间" } \ No newline at end of file diff --git a/admin/src/app/lang/zh-cn/physical_test.physical_test.json b/admin/src/app/lang/zh-cn/physical_test.physical_test.json index e8661df7..478af9c2 100644 --- a/admin/src/app/lang/zh-cn/physical_test.physical_test.json +++ b/admin/src/app/lang/zh-cn/physical_test.physical_test.json @@ -1,43 +1,37 @@ { - "id": "体测编号", - "idPlaceholder": "请输入体测编号", - "resourceId": "资源ID", - "resourceIdPlaceholder": "请输入资源ID", - "studentId": "学员ID", - "studentIdPlaceholder": "请输入学员ID", - "height": "身高", - "heightPlaceholder": "请输入身高", - "weight": "体重", - "weightPlaceholder": "请输入体重", - "coachId": "教练ID", - "coachIdPlaceholder": "请输入教练ID", - "createdAt": "创建时间", - "createdAtPlaceholder": "请输入创建时间", - "updatedAt": "修改时间", - "updatedAtPlaceholder": "请输入修改时间", - "seatedForwardBend": "坐位体前屈", - "seatedForwardBendPlaceholder": "请输入坐位体前屈", - "sitUps": "仰卧卷腹", - "sitUpsPlaceholder": "请输入仰卧卷腹", - "pushUps": "九十度仰卧撑", - "pushUpsPlaceholder": "请输入九十度仰卧撑", - "flamingoBalance": "火烈鸟平衡测试", - "flamingoBalancePlaceholder": "请输入火烈鸟平衡测试", - "thirtySecJump": "三十秒双脚连续跳", - "thirtySecJumpPlaceholder": "请输入三十秒双脚连续跳", - "standingLongJump": "立定跳远", - "standingLongJumpPlaceholder": "请输入立定跳远", - "agilityRun": "4乘10m灵敏折返跑", - "agilityRunPlaceholder": "请输入4乘10m灵敏折返跑", - "balanceBeam": "走平衡木", - "balanceBeamPlaceholder": "请输入走平衡木", - "tennisThrow": "网球掷远", - "tennisThrowPlaceholder": "请输入网球掷远", - "tenMeterShuttleRun": "十米往返跑", - "tenMeterShuttleRunPlaceholder": "请输入十米往返跑", - "addPhysicalTest": "添加体测", - "updatePhysicalTest": "编辑体测", - "physicalTestDeleteTips": "确定要删除该数据吗?", - "startDate": "请选择开始时间", - "endDate": "请选择结束时间" -} + "resourceId":"客户姓名", + "resourceIdPlaceholder":"全部", + "studentId":"学员姓名", + "studentIdPlaceholder":"全部", + "height":"身高", + "heightPlaceholder":"请输入身高", + "weight":"体重", + "weightPlaceholder":"请输入体重", + "coachId":"教练", + "coachIdPlaceholder":"请输入教练", + "seatedForwardBend":"坐位体前屈", + "seatedForwardBendPlaceholder":"请输入坐位体前屈", + "sitUps":"仰卧卷腹", + "sitUpsPlaceholder":"请输入仰卧卷腹", + "pushUps":"九十度仰卧撑", + "pushUpsPlaceholder":"请输入九十度仰卧撑", + "flamingoBalance":"火烈鸟平衡测试", + "flamingoBalancePlaceholder":"请输入火烈鸟平衡测试", + "thirtySecJump":"三十秒双脚连续跳", + "thirtySecJumpPlaceholder":"请输入三十秒双脚连续跳", + "standingLongJump":"立定跳远", + "standingLongJumpPlaceholder":"请输入立定跳远", + "agilityRun":"4乘10m灵敏折返跑", + "agilityRunPlaceholder":"请输入4乘10m灵敏折返跑", + "balanceBeam":"走平衡木", + "balanceBeamPlaceholder":"请输入走平衡木", + "tennisThrow":"网球掷远", + "tennisThrowPlaceholder":"请输入网球掷远", + "tenMeterShuttleRun":"十米往返跑", + "tenMeterShuttleRunPlaceholder":"请输入十米往返跑", + "addPhysicalTest":"添加体测", + "updatePhysicalTest":"编辑体测", + "physicalTestDeleteTips":"确定要删除该数据吗?", + "startDate":"请选择开始时间", + "endDate":"请选择结束时间" +} \ No newline at end of file diff --git a/admin/src/app/lang/zh-cn/physical_test.physical_test_edit.json b/admin/src/app/lang/zh-cn/physical_test.physical_test_edit.json new file mode 100644 index 00000000..dc9a1bc5 --- /dev/null +++ b/admin/src/app/lang/zh-cn/physical_test.physical_test_edit.json @@ -0,0 +1,39 @@ +{ + "resourceId":"客户姓名", + "studentId":"学员姓名", + "height":"身高", + "weight":"体重", + "coachId":"教练", + "createdAt":"创建时间", + "updatedAt":"修改时间", + "seatedForwardBend":"坐位体前屈", + "sitUps":"仰卧卷腹", + "pushUps":"九十度仰卧撑", + "flamingoBalance":"火烈鸟平衡测试", + "thirtySecJump":"三十秒双脚连续跳", + "standingLongJump":"立定跳远", + "agilityRun":"4乘10m灵敏折返跑", + "balanceBeam":"走平衡木", + "tennisThrow":"网球掷远", + "tenMeterShuttleRun":"十米往返跑", + "resourceIdPlaceholder":"请选择客户姓名", + "studentIdPlaceholder":"请选择学员姓名", + "heightPlaceholder":"请输入身高", + "weightPlaceholder":"请输入体重", + "coachIdPlaceholder":"请选择教练", + "createdAtPlaceholder":"请输入创建时间", + "updatedAtPlaceholder":"请输入修改时间", + "seatedForwardBendPlaceholder":"请输入坐位体前屈", + "sitUpsPlaceholder":"请输入仰卧卷腹", + "pushUpsPlaceholder":"请输入九十度仰卧撑", + "flamingoBalancePlaceholder":"请输入火烈鸟平衡测试", + "thirtySecJumpPlaceholder":"请输入三十秒双脚连续跳", + "standingLongJumpPlaceholder":"请输入立定跳远", + "agilityRunPlaceholder":"请输入4乘10m灵敏折返跑", + "balanceBeamPlaceholder":"请输入走平衡木", + "tennisThrowPlaceholder":"请输入网球掷远", + "tenMeterShuttleRunPlaceholder":"请输入十米往返跑", + "addPhysicalTest":"添加体测", + "updatePhysicalTest":"编辑体测", + "physicalTestDeleteTips":"确定要删除该体测吗?" +} \ No newline at end of file diff --git a/admin/src/app/lang/zh-cn/tc_dialog.physical_test_edit.json b/admin/src/app/lang/zh-cn/tc_dialog.physical_test_edit.json new file mode 100644 index 00000000..478af9c2 --- /dev/null +++ b/admin/src/app/lang/zh-cn/tc_dialog.physical_test_edit.json @@ -0,0 +1,37 @@ +{ + "resourceId":"客户姓名", + "resourceIdPlaceholder":"全部", + "studentId":"学员姓名", + "studentIdPlaceholder":"全部", + "height":"身高", + "heightPlaceholder":"请输入身高", + "weight":"体重", + "weightPlaceholder":"请输入体重", + "coachId":"教练", + "coachIdPlaceholder":"请输入教练", + "seatedForwardBend":"坐位体前屈", + "seatedForwardBendPlaceholder":"请输入坐位体前屈", + "sitUps":"仰卧卷腹", + "sitUpsPlaceholder":"请输入仰卧卷腹", + "pushUps":"九十度仰卧撑", + "pushUpsPlaceholder":"请输入九十度仰卧撑", + "flamingoBalance":"火烈鸟平衡测试", + "flamingoBalancePlaceholder":"请输入火烈鸟平衡测试", + "thirtySecJump":"三十秒双脚连续跳", + "thirtySecJumpPlaceholder":"请输入三十秒双脚连续跳", + "standingLongJump":"立定跳远", + "standingLongJumpPlaceholder":"请输入立定跳远", + "agilityRun":"4乘10m灵敏折返跑", + "agilityRunPlaceholder":"请输入4乘10m灵敏折返跑", + "balanceBeam":"走平衡木", + "balanceBeamPlaceholder":"请输入走平衡木", + "tennisThrow":"网球掷远", + "tennisThrowPlaceholder":"请输入网球掷远", + "tenMeterShuttleRun":"十米往返跑", + "tenMeterShuttleRunPlaceholder":"请输入十米往返跑", + "addPhysicalTest":"添加体测", + "updatePhysicalTest":"编辑体测", + "physicalTestDeleteTips":"确定要删除该数据吗?", + "startDate":"请选择开始时间", + "endDate":"请选择结束时间" +} \ No newline at end of file diff --git a/admin/src/app/views/customer_resources/customer_resources.vue b/admin/src/app/views/customer_resources/customer_resources.vue index ed81108e..ca1df18a 100644 --- a/admin/src/app/views/customer_resources/customer_resources.vue +++ b/admin/src/app/views/customer_resources/customer_resources.vue @@ -98,7 +98,7 @@ - + @@ -141,6 +143,8 @@ + + @@ -156,6 +160,8 @@ import Edit from '@/app/views/customer_resources/components/customer-resources-edit.vue' import Fp from '@/app/views/customer_resources/components/fp.vue' import Order from '@/app/views/order_table/components/order-table-edit.vue' + + import Tc from '@/app/views/tc_dialog/tc_dialog.vue' import { useRouter, useRoute } from 'vue-router' const route = useRoute() @@ -212,6 +218,15 @@ } + const TcCustomerResourcesDialog : Record | null = ref(null) + const tcEvent = (row : any) => { + TcCustomerResourcesDialog.value.setFormData(row) + TcCustomerResourcesDialog.value.showDialog = true + } + + + + const searchFormRef = ref() // 选中数据 diff --git a/admin/src/app/views/physical_test/components/physical-test-edit.vue b/admin/src/app/views/physical_test/components/physical-test-edit.vue index 07e37708..fc37d730 100644 --- a/admin/src/app/views/physical_test/components/physical-test-edit.vue +++ b/admin/src/app/views/physical_test/components/physical-test-edit.vue @@ -1,399 +1,324 @@ - - - - - - + + + + + + diff --git a/admin/src/app/views/physical_test/physical_test.vue b/admin/src/app/views/physical_test/physical_test.vue index 58daec25..f185c9bb 100644 --- a/admin/src/app/views/physical_test/physical_test.vue +++ b/admin/src/app/views/physical_test/physical_test.vue @@ -1,428 +1,204 @@ - - - - - + + + + + diff --git a/admin/src/app/views/physical_test/physical_test_edit.vue b/admin/src/app/views/physical_test/physical_test_edit.vue new file mode 100644 index 00000000..bf274a9d --- /dev/null +++ b/admin/src/app/views/physical_test/physical_test_edit.vue @@ -0,0 +1,339 @@ + + + + + diff --git a/admin/src/app/views/tc_dialog/tc_dialog.vue b/admin/src/app/views/tc_dialog/tc_dialog.vue new file mode 100644 index 00000000..9a4e3fac --- /dev/null +++ b/admin/src/app/views/tc_dialog/tc_dialog.vue @@ -0,0 +1,239 @@ + + + + + diff --git a/niucloud/app/adminapi/controller/physical_test/PhysicalTest.php b/niucloud/app/adminapi/controller/physical_test/PhysicalTest.php index 5a55a972..e4b9dff2 100644 --- a/niucloud/app/adminapi/controller/physical_test/PhysicalTest.php +++ b/niucloud/app/adminapi/controller/physical_test/PhysicalTest.php @@ -29,22 +29,7 @@ class PhysicalTest extends BaseAdminController public function lists(){ $data = $this->request->params([ ["resource_id",""], - ["student_id",""], - ["height",""], - ["weight",""], - ["coach_id",""], - ["created_at",""], - ["updated_at",""], - ["seated_forward_bend",""], - ["sit_ups",""], - ["push_ups",""], - ["flamingo_balance",""], - ["thirty_sec_jump",""], - ["standing_long_jump",""], - ["agility_run",""], - ["balance_beam",""], - ["tennis_throw",""], - ["ten_meter_shuttle_run",""] + ["student_id",""] ]); return success((new PhysicalTestService())->getPage($data)); } @@ -69,8 +54,6 @@ class PhysicalTest extends BaseAdminController ["height",0.00], ["weight",0.00], ["coach_id",0], - ["created_at",1747389000], - ["updated_at",1747389000], ["seated_forward_bend",0.00], ["sit_ups",0.00], ["push_ups",0.00], @@ -99,8 +82,6 @@ class PhysicalTest extends BaseAdminController ["height",0.00], ["weight",0.00], ["coach_id",0], - ["created_at",1747389000], - ["updated_at",1747389000], ["seated_forward_bend",0.00], ["sit_ups",0.00], ["push_ups",0.00], @@ -128,4 +109,16 @@ class PhysicalTest extends BaseAdminController } + public function getCustomerResourcesAll(){ + return success(( new PhysicalTestService())->getCustomerResourcesAll()); + } + + public function getStudentAll(){ + return success(( new PhysicalTestService())->getStudentAll()); + } + + public function getPersonnelAll(){ + return success(( new PhysicalTestService())->getPersonnelAll()); + } + } diff --git a/niucloud/app/adminapi/route/physical_test.php b/niucloud/app/adminapi/route/physical_test.php index 0cdc28f0..4a6cce0f 100644 --- a/niucloud/app/adminapi/route/physical_test.php +++ b/niucloud/app/adminapi/route/physical_test.php @@ -15,6 +15,9 @@ use app\adminapi\middleware\AdminCheckRole; use app\adminapi\middleware\AdminCheckToken; use app\adminapi\middleware\AdminLog; + + + // USER_CODE_BEGIN -- physical_test Route::group('physical_test', function () { @@ -30,6 +33,12 @@ Route::group('physical_test', function () { //删除体测 Route::delete('physical_test/:id', 'physical_test.PhysicalTest/del'); + Route::get('customer_resources_all','physical_test.PhysicalTest/getCustomerResourcesAll'); + + Route::get('student_all','physical_test.PhysicalTest/getStudentAll'); + + Route::get('personnel_all','physical_test.PhysicalTest/getPersonnelAll'); + })->middleware([ AdminCheckToken::class, AdminCheckRole::class, diff --git a/niucloud/app/model/physical_test/PhysicalTest.php b/niucloud/app/model/physical_test/PhysicalTest.php index 8e4a2be0..c81da6ec 100644 --- a/niucloud/app/model/physical_test/PhysicalTest.php +++ b/niucloud/app/model/physical_test/PhysicalTest.php @@ -16,6 +16,12 @@ use think\model\concern\SoftDelete; use think\model\relation\HasMany; use think\model\relation\HasOne; +use app\model\customer_resources\CustomerResources; + +use app\model\student\Student; + +use app\model\personnel\Personnel; + /** * 体测模型 * Class PhysicalTest @@ -43,19 +49,7 @@ class PhysicalTest extends BaseModel /** - * 搜索器:体测体测编号 - * @param $value - * @param $data - */ - public function searchIdAttr($query, $value, $data) - { - if ($value) { - $query->where("id", $value); - } - } - - /** - * 搜索器:体测资源ID + * 搜索器:体测客户姓名 * @param $value * @param $data */ @@ -67,7 +61,7 @@ class PhysicalTest extends BaseModel } /** - * 搜索器:体测学员ID + * 搜索器:体测学员姓名 * @param $value * @param $data */ @@ -78,189 +72,21 @@ class PhysicalTest extends BaseModel } } - /** - * 搜索器:体测身高 - * @param $value - * @param $data - */ - public function searchHeightAttr($query, $value, $data) - { - if ($value) { - $query->where("height", $value); - } - } - - /** - * 搜索器:体测体重 - * @param $value - * @param $data - */ - public function searchWeightAttr($query, $value, $data) - { - if ($value) { - $query->where("weight", $value); - } - } - - /** - * 搜索器:体测教练ID - * @param $value - * @param $data - */ - public function searchCoachIdAttr($query, $value, $data) - { - if ($value) { - $query->where("coach_id", $value); - } - } - /** - * 搜索器:体测创建时间 - * @param $value - * @param $data - */ - public function searchCreatedAtAttr($query, $value, $data) - { - if ($value) { - $query->where("created_at", $value); - } - } - - /** - * 搜索器:体测修改时间 - * @param $value - * @param $data - */ - public function searchUpdatedAtAttr($query, $value, $data) - { - if ($value) { - $query->where("updated_at", $value); - } - } - - /** - * 搜索器:体测坐位体前屈 - * @param $value - * @param $data - */ - public function searchSeatedForwardBendAttr($query, $value, $data) - { - if ($value) { - $query->where("seated_forward_bend", $value); - } - } - - /** - * 搜索器:体测仰卧卷腹 - * @param $value - * @param $data - */ - public function searchSitUpsAttr($query, $value, $data) - { - if ($value) { - $query->where("sit_ups", $value); - } - } - - /** - * 搜索器:体测九十度仰卧撑 - * @param $value - * @param $data - */ - public function searchPushUpsAttr($query, $value, $data) - { - if ($value) { - $query->where("push_ups", $value); - } - } - - /** - * 搜索器:体测火烈鸟平衡测试 - * @param $value - * @param $data - */ - public function searchFlamingoBalanceAttr($query, $value, $data) - { - if ($value) { - $query->where("flamingo_balance", $value); - } - } - - /** - * 搜索器:体测三十秒双脚连续跳 - * @param $value - * @param $data - */ - public function searchThirtySecJumpAttr($query, $value, $data) - { - if ($value) { - $query->where("thirty_sec_jump", $value); - } - } - - /** - * 搜索器:体测立定跳远 - * @param $value - * @param $data - */ - public function searchStandingLongJumpAttr($query, $value, $data) - { - if ($value) { - $query->where("standing_long_jump", $value); - } - } - - /** - * 搜索器:体测4乘10m灵敏折返跑 - * @param $value - * @param $data - */ - public function searchAgilityRunAttr($query, $value, $data) - { - if ($value) { - $query->where("agility_run", $value); - } - } + - /** - * 搜索器:体测走平衡木 - * @param $value - * @param $data - */ - public function searchBalanceBeamAttr($query, $value, $data) - { - if ($value) { - $query->where("balance_beam", $value); - } - } + - /** - * 搜索器:体测网球掷远 - * @param $value - * @param $data - */ - public function searchTennisThrowAttr($query, $value, $data) - { - if ($value) { - $query->where("tennis_throw", $value); - } + public function customerResources(){ + return $this->hasOne(CustomerResources::class, 'id', 'resource_id')->joinType('left')->withField('name,id')->bind(['resource_id_name'=>'name']); } - - /** - * 搜索器:体测十米往返跑 - * @param $value - * @param $data - */ - public function searchTenMeterShuttleRunAttr($query, $value, $data) - { - if ($value) { - $query->where("ten_meter_shuttle_run", $value); - } + + public function student(){ + return $this->hasOne(Student::class, 'id', 'student_id')->joinType('left')->withField('name,id')->bind(['student_id_name'=>'name']); } - - - + public function personnel(){ + return $this->hasOne(Personnel::class, 'id', 'coach_id')->joinType('left')->withField('name,id')->bind(['coach_id_name'=>'name']); + } - } diff --git a/niucloud/app/service/admin/physical_test/PhysicalTestService.php b/niucloud/app/service/admin/physical_test/PhysicalTestService.php index c01e49d8..175d8e18 100644 --- a/niucloud/app/service/admin/physical_test/PhysicalTestService.php +++ b/niucloud/app/service/admin/physical_test/PhysicalTestService.php @@ -12,6 +12,9 @@ namespace app\service\admin\physical_test; use app\model\physical_test\PhysicalTest; +use app\model\customer_resources\CustomerResources; +use app\model\student\Student; +use app\model\personnel\Personnel; use core\base\BaseAdminService; @@ -39,7 +42,7 @@ class PhysicalTestService extends BaseAdminService $field = 'id,resource_id,student_id,height,weight,coach_id,created_at,updated_at,seated_forward_bend,sit_ups,push_ups,flamingo_balance,thirty_sec_jump,standing_long_jump,agility_run,balance_beam,tennis_throw,ten_meter_shuttle_run'; $order = 'id desc'; - $search_model = $this->model->withSearch(["id","resource_id","student_id","height","weight","coach_id","created_at","updated_at","seated_forward_bend","sit_ups","push_ups","flamingo_balance","thirty_sec_jump","standing_long_jump","agility_run","balance_beam","tennis_throw","ten_meter_shuttle_run"], $where)->field($field)->order($order); + $search_model = $this->model->withSearch(["resource_id","student_id"], $where)->with(['customerResources','student','personnel'])->field($field)->order($order); $list = $this->pageQuery($search_model); return $list; } @@ -53,7 +56,7 @@ class PhysicalTestService extends BaseAdminService { $field = 'id,resource_id,student_id,height,weight,coach_id,created_at,updated_at,seated_forward_bend,sit_ups,push_ups,flamingo_balance,thirty_sec_jump,standing_long_jump,agility_run,balance_beam,tennis_throw,ten_meter_shuttle_run'; - $info = $this->model->field($field)->where([['id', "=", $id]])->findOrEmpty()->toArray(); + $info = $this->model->field($field)->where([['id', "=", $id]])->with(['customerResources','student','personnel'])->findOrEmpty()->toArray(); return $info; } @@ -95,5 +98,20 @@ class PhysicalTestService extends BaseAdminService } + public function getCustomerResourcesAll(){ + $customerResourcesModel = new CustomerResources(); + return $customerResourcesModel->select()->toArray(); + } + + public function getStudentAll(){ + $studentModel = new Student(); + return $studentModel->select()->toArray(); + } + + public function getPersonnelAll(){ + $personnelModel = new Personnel(); + return $personnelModel->select()->toArray(); + } + } diff --git a/niucloud/app/validate/physical_test/PhysicalTest.php b/niucloud/app/validate/physical_test/PhysicalTest.php index 712644e5..dfedafc4 100644 --- a/niucloud/app/validate/physical_test/PhysicalTest.php +++ b/niucloud/app/validate/physical_test/PhysicalTest.php @@ -36,8 +36,8 @@ class PhysicalTest extends BaseValidate ]; protected $scene = [ - "add" => ['resource_id', 'student_id', 'height', 'weight', 'coach_id', 'created_at', 'updated_at', 'seated_forward_bend', 'sit_ups', 'push_ups', 'flamingo_balance', 'thirty_sec_jump', 'standing_long_jump', 'agility_run', 'balance_beam', 'tennis_throw', 'ten_meter_shuttle_run'], - "edit" => ['resource_id', 'student_id', 'height', 'weight', 'coach_id', 'created_at', 'updated_at', 'seated_forward_bend', 'sit_ups', 'push_ups', 'flamingo_balance', 'thirty_sec_jump', 'standing_long_jump', 'agility_run', 'balance_beam', 'tennis_throw', 'ten_meter_shuttle_run'] + "add" => ['resource_id', 'student_id', 'height', 'weight', 'coach_id', 'seated_forward_bend', 'sit_ups', 'push_ups', 'flamingo_balance', 'thirty_sec_jump', 'standing_long_jump', 'agility_run', 'balance_beam', 'tennis_throw', 'ten_meter_shuttle_run'], + "edit" => ['resource_id', 'student_id', 'height', 'weight', 'coach_id', 'seated_forward_bend', 'sit_ups', 'push_ups', 'flamingo_balance', 'thirty_sec_jump', 'standing_long_jump', 'agility_run', 'balance_beam', 'tennis_throw', 'ten_meter_shuttle_run'] ]; }