54 changed files with 3192 additions and 247 deletions
@ -0,0 +1,56 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// USER_CODE_BEGIN -- market_performance
|
|||
/** |
|||
* 获取市场绩效列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function getMarketPerformanceList(params: Record<string, any>) { |
|||
return request.get(`market_performance/market_performance`, {params}) |
|||
} |
|||
|
|||
/** |
|||
* 获取市场绩效详情 |
|||
* @param id 市场绩效id |
|||
* @returns |
|||
*/ |
|||
export function getMarketPerformanceInfo(id: number) { |
|||
return request.get(`market_performance/market_performance/${id}`); |
|||
} |
|||
|
|||
/** |
|||
* 添加市场绩效 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function addMarketPerformance(params: Record<string, any>) { |
|||
return request.post('market_performance/market_performance', params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
/** |
|||
* 编辑市场绩效 |
|||
* @param id |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function editMarketPerformance(params: Record<string, any>) { |
|||
return request.put(`market_performance/market_performance/${params.id}`, params, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
/** |
|||
* 删除市场绩效 |
|||
* @param id |
|||
* @returns |
|||
*/ |
|||
export function deleteMarketPerformance(id: number) { |
|||
return request.delete(`market_performance/market_performance/${id}`, { showErrorMessage: true, showSuccessMessage: true }) |
|||
} |
|||
|
|||
export function getWithPersonnelList(params: Record<string,any>){ |
|||
return request.get('market_performance/personnel_all', {params}) |
|||
}export function getWithCampusList(params: Record<string,any>){ |
|||
return request.get('market_performance/campus_all', {params}) |
|||
} |
|||
|
|||
// USER_CODE_END -- market_performance
|
|||
@ -0,0 +1,13 @@ |
|||
{ |
|||
"personnelId":"人员", |
|||
"personnelIdPlaceholder":"请输入人员", |
|||
"campusId":"校区", |
|||
"campusIdPlaceholder":"全部", |
|||
"performanceAmount":"绩效金额", |
|||
"performanceAmountPlaceholder":"请输入绩效金额", |
|||
"addMarketPerformance":"添加市场绩效", |
|||
"updateMarketPerformance":"编辑市场绩效", |
|||
"marketPerformanceDeleteTips":"确定要删除该数据吗?", |
|||
"startDate":"请选择开始时间", |
|||
"endDate":"请选择结束时间" |
|||
} |
|||
@ -0,0 +1,189 @@ |
|||
<template> |
|||
<el-dialog v-model="showDialog" :title="formData.id ? t('updateMarketPerformance') : t('addMarketPerformance')" width="50%" class="diy-dialog-wrap" :destroy-on-close="true"> |
|||
<el-form :model="formData" label-width="120px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading"> |
|||
<el-form-item :label="t('personnelId')" > |
|||
<el-select class="input-width" v-model="formData.personnel_id" clearable :placeholder="t('personnelIdPlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in personnelIdList" |
|||
:key="index" |
|||
:label="item['name']" |
|||
:value="item['id']" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('campusId')" > |
|||
<el-select class="input-width" v-model="formData.campus_id" clearable :placeholder="t('campusIdPlaceholder')"> |
|||
<el-option label="请选择" value=""></el-option> |
|||
<el-option |
|||
v-for="(item, index) in campusIdList" |
|||
:key="index" |
|||
:label="item['campus_name']" |
|||
:value="item['id']" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('performanceAmount')" > |
|||
<el-input v-model="formData.performance_amount" clearable :placeholder="t('performanceAmountPlaceholder')" class="input-width" /> |
|||
</el-form-item> |
|||
|
|||
</el-form> |
|||
|
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button> |
|||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ |
|||
t('confirm') |
|||
}}</el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, reactive, computed, watch } from 'vue' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { t } from '@/lang' |
|||
import type { FormInstance } from 'element-plus' |
|||
import { addMarketPerformance, editMarketPerformance, getMarketPerformanceInfo, getWithPersonnelList, getWithCampusList } from '@/app/api/market_performance' |
|||
|
|||
let showDialog = ref(false) |
|||
const loading = ref(false) |
|||
|
|||
/** |
|||
* 表单数据 |
|||
*/ |
|||
const initialFormData = { |
|||
id: '', |
|||
personnel_id: '', |
|||
campus_id: '', |
|||
performance_amount: '', |
|||
} |
|||
const formData: Record<string, any> = reactive({ ...initialFormData }) |
|||
|
|||
const formRef = ref<FormInstance>() |
|||
|
|||
// 表单验证规则 |
|||
const formRules = computed(() => { |
|||
return { |
|||
personnel_id: [ |
|||
{ required: true, message: t('personnelIdPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
campus_id: [ |
|||
{ required: true, message: t('campusIdPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
performance_amount: [ |
|||
{ required: true, message: t('performanceAmountPlaceholder'), trigger: 'blur' }, |
|||
|
|||
] |
|||
, |
|||
} |
|||
}) |
|||
|
|||
const emit = defineEmits(['complete']) |
|||
|
|||
/** |
|||
* 确认 |
|||
* @param formEl |
|||
*/ |
|||
const confirm = async (formEl: FormInstance | undefined) => { |
|||
if (loading.value || !formEl) return |
|||
let save = formData.id ? editMarketPerformance : addMarketPerformance |
|||
|
|||
await formEl.validate(async (valid) => { |
|||
if (valid) { |
|||
loading.value = true |
|||
|
|||
let data = formData |
|||
|
|||
save(data).then(res => { |
|||
loading.value = false |
|||
showDialog.value = false |
|||
emit('complete') |
|||
}).catch(err => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
// 获取字典数据 |
|||
|
|||
|
|||
|
|||
const personnelIdList = ref([] as any[]) |
|||
const setPersonnelIdList = async () => { |
|||
personnelIdList.value = await (await getWithPersonnelList({})).data |
|||
} |
|||
setPersonnelIdList() |
|||
const campusIdList = ref([] as any[]) |
|||
const setCampusIdList = async () => { |
|||
campusIdList.value = await (await getWithCampusList({})).data |
|||
} |
|||
setCampusIdList() |
|||
const setFormData = async (row: any = null) => { |
|||
Object.assign(formData, initialFormData) |
|||
loading.value = true |
|||
if(row){ |
|||
const data = await (await getMarketPerformanceInfo(row.id)).data |
|||
if (data) Object.keys(formData).forEach((key: string) => { |
|||
if (data[key] != undefined) formData[key] = data[key] |
|||
}) |
|||
} |
|||
loading.value = false |
|||
} |
|||
|
|||
// 验证手机号格式 |
|||
const mobileVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^1[3-9]\d{9}$/.test(value)) { |
|||
callback(new Error(t('generateMobile'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证身份证号 |
|||
const idCardVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)) { |
|||
callback(new Error(t('generateIdCard'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证邮箱号 |
|||
const emailVerify = (rule: any, value: any, callback: any) => { |
|||
if (value && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)) { |
|||
callback(new Error(t('generateEmail'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
// 验证请输入整数 |
|||
const numberVerify = (rule: any, value: any, callback: any) => { |
|||
if (!Number.isInteger(value)) { |
|||
callback(new Error(t('generateNumber'))) |
|||
} else { |
|||
callback() |
|||
} |
|||
} |
|||
|
|||
defineExpose({ |
|||
showDialog, |
|||
setFormData |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
<style lang="scss"> |
|||
.diy-dialog-wrap .el-form-item__label{ |
|||
height: auto !important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,186 @@ |
|||
<template> |
|||
<div class="main-container"> |
|||
<el-card class="box-card !border-none" shadow="never"> |
|||
|
|||
<div class="flex justify-between items-center"> |
|||
<span class="text-lg">{{pageName}}</span> |
|||
<!-- <el-button type="primary" @click="addEvent"> |
|||
{{ t('addMarketPerformance') }} |
|||
</el-button> --> |
|||
</div> |
|||
|
|||
<el-card class="box-card !border-none my-[10px] table-search-wrap" shadow="never"> |
|||
<el-form :inline="true" :model="marketPerformanceTable.searchParam" ref="searchFormRef"> |
|||
|
|||
<el-form-item :label="t('campusId')" prop="campus_id"> |
|||
<el-select class="w-[280px]" v-model="marketPerformanceTable.searchParam.campus_id" clearable :placeholder="t('campusIdPlaceholder')"> |
|||
<el-option |
|||
v-for="(item, index) in campusIdList" |
|||
:key="index" |
|||
:label="item['campus_name']" |
|||
:value="item['id']" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="t('performanceAmount')" prop="performance_amount"> |
|||
<el-input v-model="marketPerformanceTable.searchParam.performance_amount" :placeholder="t('performanceAmountPlaceholder')" /> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" @click="loadMarketPerformanceList()">{{ t('search') }}</el-button> |
|||
<el-button @click="resetForm(searchFormRef)">{{ t('reset') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<div class="mt-[10px]"> |
|||
<el-table :data="marketPerformanceTable.data" size="large" v-loading="marketPerformanceTable.loading"> |
|||
<template #empty> |
|||
<span>{{ !marketPerformanceTable.loading ? t('emptyData') : '' }}</span> |
|||
</template> |
|||
<el-table-column prop="personnel_id_name" :label="t('personnelId')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column prop="campus_id_name" :label="t('campusId')" min-width="120" :show-overflow-tooltip="true"/> |
|||
|
|||
<el-table-column prop="performance_amount" :label="t('performanceAmount')" min-width="120" :show-overflow-tooltip="true"/> |
|||
<!-- |
|||
<el-table-column :label="t('operation')" fixed="right" min-width="120"> |
|||
<template #default="{ row }"> |
|||
<el-button type="primary" link @click="editEvent(row)">{{ t('edit') }}</el-button> |
|||
<el-button type="primary" link @click="deleteEvent(row.id)">{{ t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> --> |
|||
|
|||
</el-table> |
|||
<div class="mt-[16px] flex justify-end"> |
|||
<el-pagination v-model:current-page="marketPerformanceTable.page" v-model:page-size="marketPerformanceTable.limit" |
|||
layout="total, sizes, prev, pager, next, jumper" :total="marketPerformanceTable.total" |
|||
@size-change="loadMarketPerformanceList()" @current-change="loadMarketPerformanceList" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<edit ref="editMarketPerformanceDialog" @complete="loadMarketPerformanceList" /> |
|||
</el-card> |
|||
</div> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { reactive, ref, watch } from 'vue' |
|||
import { t } from '@/lang' |
|||
import { useDictionary } from '@/app/api/dict' |
|||
import { getMarketPerformanceList, deleteMarketPerformance, getWithPersonnelList, getWithCampusList } from '@/app/api/market_performance' |
|||
import { img } from '@/utils/common' |
|||
import { ElMessageBox,FormInstance } from 'element-plus' |
|||
import Edit from '@/app/views/market_performance/components/market-performance-edit.vue' |
|||
import { useRoute } from 'vue-router' |
|||
const route = useRoute() |
|||
const pageName = route.meta.title; |
|||
|
|||
let marketPerformanceTable = reactive({ |
|||
page: 1, |
|||
limit: 10, |
|||
total: 0, |
|||
loading: true, |
|||
data: [], |
|||
searchParam:{ |
|||
"campus_id":"", |
|||
"performance_amount":"" |
|||
} |
|||
}) |
|||
|
|||
const searchFormRef = ref<FormInstance>() |
|||
|
|||
// 选中数据 |
|||
const selectData = ref<any[]>([]) |
|||
|
|||
// 字典数据 |
|||
|
|||
|
|||
/** |
|||
* 获取市场绩效列表 |
|||
*/ |
|||
const loadMarketPerformanceList = (page: number = 1) => { |
|||
marketPerformanceTable.loading = true |
|||
marketPerformanceTable.page = page |
|||
|
|||
getMarketPerformanceList({ |
|||
page: marketPerformanceTable.page, |
|||
limit: marketPerformanceTable.limit, |
|||
...marketPerformanceTable.searchParam |
|||
}).then(res => { |
|||
marketPerformanceTable.loading = false |
|||
marketPerformanceTable.data = res.data.data |
|||
marketPerformanceTable.total = res.data.total |
|||
}).catch(() => { |
|||
marketPerformanceTable.loading = false |
|||
}) |
|||
} |
|||
loadMarketPerformanceList() |
|||
|
|||
const editMarketPerformanceDialog: Record<string, any> | null = ref(null) |
|||
|
|||
/** |
|||
* 添加市场绩效 |
|||
*/ |
|||
const addEvent = () => { |
|||
editMarketPerformanceDialog.value.setFormData() |
|||
editMarketPerformanceDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 编辑市场绩效 |
|||
* @param data |
|||
*/ |
|||
const editEvent = (data: any) => { |
|||
editMarketPerformanceDialog.value.setFormData(data) |
|||
editMarketPerformanceDialog.value.showDialog = true |
|||
} |
|||
|
|||
/** |
|||
* 删除市场绩效 |
|||
*/ |
|||
const deleteEvent = (id: number) => { |
|||
ElMessageBox.confirm(t('marketPerformanceDeleteTips'), t('warning'), |
|||
{ |
|||
confirmButtonText: t('confirm'), |
|||
cancelButtonText: t('cancel'), |
|||
type: 'warning', |
|||
} |
|||
).then(() => { |
|||
deleteMarketPerformance(id).then(() => { |
|||
loadMarketPerformanceList() |
|||
}).catch(() => { |
|||
}) |
|||
}) |
|||
} |
|||
|
|||
|
|||
const personnelIdList = ref([]) |
|||
const setPersonnelIdList = async () => { |
|||
personnelIdList.value = await (await getWithPersonnelList({})).data |
|||
} |
|||
setPersonnelIdList() |
|||
const campusIdList = ref([]) |
|||
const setCampusIdList = async () => { |
|||
campusIdList.value = await (await getWithCampusList({})).data |
|||
} |
|||
setCampusIdList() |
|||
|
|||
const resetForm = (formEl: FormInstance | undefined) => { |
|||
if (!formEl) return |
|||
formEl.resetFields() |
|||
loadMarketPerformanceList() |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
/* 多行超出隐藏 */ |
|||
.multi-hidden { |
|||
word-break: break-all; |
|||
text-overflow: ellipsis; |
|||
overflow: hidden; |
|||
display: -webkit-box; |
|||
-webkit-line-clamp: 2; |
|||
-webkit-box-orient: vertical; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,107 @@ |
|||
<template> |
|||
<div class="main-container"> |
|||
<el-card class="box-card !border-none" shadow="never"> |
|||
<el-form |
|||
class="page-form" |
|||
:model="formData" |
|||
label-width="150px" |
|||
ref="ruleFormRef" |
|||
:rules="formRules" |
|||
v-loading="loading" |
|||
> |
|||
<el-form-item |
|||
v-for="day in weekDays" |
|||
:key="day.key" |
|||
:label="day.label" |
|||
:prop="`priceRules.${day.key}`" |
|||
> |
|||
<span style="margin: 0 8px;">每个</span> |
|||
<el-input |
|||
v-model.number="formData.priceRules[day.key].basePrice" |
|||
placeholder="请输入" |
|||
class="input-width" |
|||
clearable |
|||
/> |
|||
<span style="margin: 0 8px;">元 超过</span> |
|||
<el-input |
|||
v-model.number="formData.priceRules[day.key].limitCount" |
|||
placeholder="请输入" |
|||
class="input-width" |
|||
clearable |
|||
/> |
|||
<span style="margin: 0 8px;">个</span> |
|||
<el-input |
|||
v-model.number="formData.priceRules[day.key].extraPrice" |
|||
placeholder="请输入" |
|||
class="input-width" |
|||
clearable |
|||
/> |
|||
<span style="margin-left: 4px;">元</span> |
|||
</el-form-item> |
|||
|
|||
|
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<div class="fixed-footer-wrap"> |
|||
<div class="fixed-footer"> |
|||
<el-button type="primary" @click="onSave()">提交</el-button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { reactive, ref } from 'vue' |
|||
import { t } from '@/lang' |
|||
import { FormInstance, FormRules } from 'element-plus' |
|||
import { yjpzConfig,getYjpzConfig} from '@/app/api/sys' |
|||
|
|||
|
|||
const loading = ref(true) |
|||
const formData = reactive({ |
|||
priceRules: { |
|||
mon: { basePrice: 0, limitCount: 0, extraPrice: 0 }, |
|||
tue: { basePrice: 0, limitCount: 0, extraPrice: 0 }, |
|||
wed: { basePrice: 0, limitCount: 0, extraPrice: 0 }, |
|||
thu: { basePrice: 0, limitCount: 0, extraPrice: 0 }, |
|||
fri: { basePrice: 0, limitCount: 0, extraPrice: 0 }, |
|||
sat: { basePrice: 0, limitCount: 0, extraPrice: 0 }, |
|||
sun: { basePrice: 0, limitCount: 0, extraPrice: 0 }, |
|||
} |
|||
}) |
|||
|
|||
const weekDays = [ |
|||
{ key: 'mon', label: '周一' }, |
|||
{ key: 'tue', label: '周二' }, |
|||
{ key: 'wed', label: '周三' }, |
|||
{ key: 'thu', label: '周四' }, |
|||
{ key: 'fri', label: '周五' }, |
|||
{ key: 'sat', label: '周六' }, |
|||
{ key: 'sun', label: '周日' }, |
|||
] |
|||
|
|||
const formRules = reactive<FormRules>({}) |
|||
|
|||
|
|||
const setFormData = async () => { |
|||
const data = await (await getYjpzConfig()).data |
|||
formData['priceRules'] = data; |
|||
loading.value = false |
|||
} |
|||
setFormData(); |
|||
const onSave = async () => { |
|||
|
|||
yjpzConfig(formData) |
|||
.then(() => { |
|||
loading.value = true |
|||
setFormData(); |
|||
}) |
|||
.catch(() => { |
|||
loading.value = false |
|||
}) |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style lang="scss" scoped></style> |
|||
@ -0,0 +1,718 @@ |
|||
<?php |
|||
// +---------------------------------------------------------------------- |
|||
// | Niucloud-admin 企业快速开发的多应用管理平台 |
|||
// +---------------------------------------------------------------------- |
|||
// | 官方网址:https://www.niucloud.com |
|||
// +---------------------------------------------------------------------- |
|||
// | niucloud团队 版权所有 开源版本可自由商用 |
|||
// +---------------------------------------------------------------------- |
|||
// | Author: Niucloud Team |
|||
// +---------------------------------------------------------------------- |
|||
|
|||
namespace app\adminapi\controller\lesson_course_teaching; |
|||
|
|||
use core\base\BaseAdminController; |
|||
use app\service\admin\lesson_course_teaching\LessonCourseTeachingService; |
|||
|
|||
|
|||
/** |
|||
* 教研管理控制器 |
|||
* Class LessonCourseTeaching |
|||
* @package app\adminapi\controller\lesson_course_teaching |
|||
*/ |
|||
class LessonCourseTeaching extends BaseAdminController |
|||
{ |
|||
/** |
|||
* 获取教研管理列表 |
|||
* @return \think\Response |
|||
*/ |
|||
public function lists(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["status",""], |
|||
["create_time",["",""]], |
|||
["update_time",["",""]], |
|||
["table_type",1] |
|||
]); |
|||
return success((new LessonCourseTeachingService())->getPage($data)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 添加教研管理 |
|||
* @return \think\Response |
|||
*/ |
|||
public function add(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
["table_type",1] |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add'); |
|||
$id = (new LessonCourseTeachingService())->add($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
|
|||
/** |
|||
* 教研管理编辑 |
|||
* @param $id 教研管理id |
|||
* @return \think\Response |
|||
*/ |
|||
public function edit(int $id){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit'); |
|||
(new LessonCourseTeachingService())->edit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
/** |
|||
* 获取跳绳教案库列表 |
|||
* @return \think\Response |
|||
*/ |
|||
public function jumpLists(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["status",""], |
|||
["create_time",["",""]], |
|||
["update_time",["",""]], |
|||
["table_type",2] |
|||
]); |
|||
return success((new LessonCourseTeachingService())->jumpPetPage($data)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 添加跳绳教案库 |
|||
* @return \think\Response |
|||
*/ |
|||
public function jumpAdd(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
["table_type",2] |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add'); |
|||
$id = (new LessonCourseTeachingService())->jumpAdd($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
|
|||
/** |
|||
* 跳绳教案库编辑 |
|||
* @param $id 教研管理id |
|||
* @return \think\Response |
|||
*/ |
|||
public function jumpEdit(int $id){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit'); |
|||
(new LessonCourseTeachingService())->jumpEdit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取增高教案库列表 |
|||
* @return \think\Response |
|||
*/ |
|||
public function enLists(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["status",""], |
|||
["create_time",["",""]], |
|||
["update_time",["",""]], |
|||
["table_type",3] |
|||
]); |
|||
return success((new LessonCourseTeachingService())->enPetPage($data)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 添加增高教案库 |
|||
* @return \think\Response |
|||
*/ |
|||
public function enAdd(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
["table_type",3] |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add'); |
|||
$id = (new LessonCourseTeachingService())->enAdd($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
|
|||
/** |
|||
* 跳绳增高教案库 |
|||
* @param $id 教研管理id |
|||
* @return \think\Response |
|||
*/ |
|||
public function enEdit(int $id){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit'); |
|||
(new LessonCourseTeachingService())->enEdit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取篮球教案库列表 |
|||
* @return \think\Response |
|||
*/ |
|||
public function basketballLists(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["status",""], |
|||
["create_time",["",""]], |
|||
["update_time",["",""]], |
|||
["table_type",4] |
|||
]); |
|||
return success((new LessonCourseTeachingService())->basketballPetPage($data)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 添加篮球教案库 |
|||
* @return \think\Response |
|||
*/ |
|||
public function basketballAdd(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
["table_type",4] |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add'); |
|||
$id = (new LessonCourseTeachingService())->basketballAdd($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
|
|||
/** |
|||
* 跳绳篮球教案库 |
|||
* @param $id 教研管理id |
|||
* @return \think\Response |
|||
*/ |
|||
public function basketballEdit(int $id){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit'); |
|||
(new LessonCourseTeachingService())->basketballEdit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取强化教案库列表 |
|||
* @return \think\Response |
|||
*/ |
|||
public function strengLists(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["status",""], |
|||
["create_time",["",""]], |
|||
["update_time",["",""]], |
|||
["table_type",5] |
|||
]); |
|||
return success((new LessonCourseTeachingService())->strengPetPage($data)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 添加强化教案库 |
|||
* @return \think\Response |
|||
*/ |
|||
public function strengAdd(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
["table_type",5] |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add'); |
|||
$id = (new LessonCourseTeachingService())->strengAdd($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
|
|||
/** |
|||
* 跳绳强化教案库 |
|||
* @param $id 教研管理id |
|||
* @return \think\Response |
|||
*/ |
|||
public function strengEdit(int $id){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit'); |
|||
(new LessonCourseTeachingService())->strengEdit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
/** |
|||
* 获取空中忍者教案库列表 |
|||
* @return \think\Response |
|||
*/ |
|||
public function ninjaLists(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["status",""], |
|||
["create_time",["",""]], |
|||
["update_time",["",""]], |
|||
["table_type",6] |
|||
]); |
|||
return success((new LessonCourseTeachingService())->ninjaPetPage($data)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 添加空中忍者教案库 |
|||
* @return \think\Response |
|||
*/ |
|||
public function ninjaAdd(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
["table_type",6] |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add'); |
|||
$id = (new LessonCourseTeachingService())->ninjaAdd($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
|
|||
/** |
|||
* 跳绳空中忍者教案库 |
|||
* @param $id 教研管理id |
|||
* @return \think\Response |
|||
*/ |
|||
public function ninjaEdit(int $id){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit'); |
|||
(new LessonCourseTeachingService())->ninjaEdit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
/** |
|||
* 获取空中忍者教案库列表 |
|||
* @return \think\Response |
|||
*/ |
|||
public function securityLists(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["status",""], |
|||
["create_time",["",""]], |
|||
["update_time",["",""]], |
|||
["table_type",7] |
|||
]); |
|||
return success((new LessonCourseTeachingService())->securityPetPage($data)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 添加空中忍者教案库 |
|||
* @return \think\Response |
|||
*/ |
|||
public function securityAdd(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
["table_type",7] |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add'); |
|||
$id = (new LessonCourseTeachingService())->securityAdd($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
|
|||
/** |
|||
* 跳绳空中忍者教案库 |
|||
* @param $id 教研管理id |
|||
* @return \think\Response |
|||
*/ |
|||
public function securityEdit(int $id){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit'); |
|||
(new LessonCourseTeachingService())->securityEdit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取体能教案库列表 |
|||
* @return \think\Response |
|||
*/ |
|||
public function physicalLists(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["status",""], |
|||
["create_time",["",""]], |
|||
["update_time",["",""]], |
|||
["table_type",8] |
|||
]); |
|||
return success((new LessonCourseTeachingService())->physicalPetPage($data)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 添加体能教案库 |
|||
* @return \think\Response |
|||
*/ |
|||
public function physicalAdd(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
["table_type",8] |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add'); |
|||
$id = (new LessonCourseTeachingService())->physicalAdd($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
|
|||
/** |
|||
* 跳绳体能教案库 |
|||
* @param $id 教研管理id |
|||
* @return \think\Response |
|||
*/ |
|||
public function physicalEdit(int $id){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit'); |
|||
(new LessonCourseTeachingService())->physicalEdit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
/** |
|||
* 获取体能教案库列表 |
|||
* @return \think\Response |
|||
*/ |
|||
public function actionLists(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["status",""], |
|||
["create_time",["",""]], |
|||
["update_time",["",""]], |
|||
["table_type",9] |
|||
]); |
|||
return success((new LessonCourseTeachingService())->actionPetPage($data)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 热身动作 |
|||
* @return \think\Response |
|||
*/ |
|||
public function actionAdd(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
["table_type",9] |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add'); |
|||
$id = (new LessonCourseTeachingService())->actionAdd($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
|
|||
/** |
|||
* 热身动作 |
|||
* @param $id 教研管理id |
|||
* @return \think\Response |
|||
*/ |
|||
public function actionEdit(int $id){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit'); |
|||
(new LessonCourseTeachingService())->actionEdit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
/** |
|||
* 获取体能教案库列表 |
|||
* @return \think\Response |
|||
*/ |
|||
public function fitnessLists(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["status",""], |
|||
["create_time",["",""]], |
|||
["update_time",["",""]], |
|||
["table_type",10] |
|||
]); |
|||
return success((new LessonCourseTeachingService())->fitnessPetPage($data)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 热身动作 |
|||
* @return \think\Response |
|||
*/ |
|||
public function fitnessAdd(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
["table_type",10] |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add'); |
|||
$id = (new LessonCourseTeachingService())->fitnessAdd($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
|
|||
/** |
|||
* 热身动作 |
|||
* @param $id 教研管理id |
|||
* @return \think\Response |
|||
*/ |
|||
public function fitnessEdit(int $id){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit'); |
|||
(new LessonCourseTeachingService())->fitnessEdit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
/** |
|||
* 获取体能教案库列表 |
|||
* @return \think\Response |
|||
*/ |
|||
public function gamesLists(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["status",""], |
|||
["create_time",["",""]], |
|||
["update_time",["",""]], |
|||
["table_type",11] |
|||
]); |
|||
return success((new LessonCourseTeachingService())->gamesPetPage($data)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 热身动作 |
|||
* @return \think\Response |
|||
*/ |
|||
public function gamesAdd(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
["table_type",11] |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add'); |
|||
$id = (new LessonCourseTeachingService())->gamesAdd($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
|
|||
/** |
|||
* 热身动作 |
|||
* @param $id 教研管理id |
|||
* @return \think\Response |
|||
*/ |
|||
public function gamesEdit(int $id){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit'); |
|||
(new LessonCourseTeachingService())->gamesEdit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取体能教案库列表 |
|||
* @return \think\Response |
|||
*/ |
|||
public function relaxationLists(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["status",""], |
|||
["create_time",["",""]], |
|||
["update_time",["",""]], |
|||
["table_type",12] |
|||
]); |
|||
return success((new LessonCourseTeachingService())->relaxationPetPage($data)); |
|||
} |
|||
|
|||
/** |
|||
* 热身动作 |
|||
* @return \think\Response |
|||
*/ |
|||
public function relaxationAdd(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
["table_type",12] |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add'); |
|||
$id = (new LessonCourseTeachingService())->relaxationAdd($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
|
|||
/** |
|||
* 热身动作 |
|||
* @param $id 教研管理id |
|||
* @return \think\Response |
|||
*/ |
|||
public function relaxationEdit(int $id){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit'); |
|||
(new LessonCourseTeachingService())->relaxationEdit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
|
|||
|
|||
public function publicLists(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["status",""], |
|||
["create_time",["",""]], |
|||
["update_time",["",""]], |
|||
["table_type",0], |
|||
]); |
|||
return success((new LessonCourseTeachingService())->publicPetPage($data)); |
|||
} |
|||
public function publicAdd(){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
["table_type",0] |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.add'); |
|||
$id = (new LessonCourseTeachingService())->publicAdd($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
public function publicEdit(int $id){ |
|||
$data = $this->request->params([ |
|||
["title",""], |
|||
["image",""], |
|||
["type",0], |
|||
["content",""], |
|||
["status",0], |
|||
]); |
|||
$this->validate($data, 'app\validate\lesson_course_teaching\LessonCourseTeaching.edit'); |
|||
(new LessonCourseTeachingService())->publicEdit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* 教研管理详情 |
|||
* @param int $id |
|||
* @return \think\Response |
|||
*/ |
|||
public function info(int $id){ |
|||
return success((new LessonCourseTeachingService())->getInfo($id)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 教研管理删除 |
|||
* @param $id 教研管理id |
|||
* @return \think\Response |
|||
*/ |
|||
public function del(int $id){ |
|||
(new LessonCourseTeachingService())->del($id); |
|||
return success('DELETE_SUCCESS'); |
|||
} |
|||
|
|||
|
|||
public function getPersonnelDataAll(){ |
|||
return success(( new LessonCourseTeachingService())->getPersonnelDataAll()); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,99 @@ |
|||
<?php |
|||
// +---------------------------------------------------------------------- |
|||
// | Niucloud-admin 企业快速开发的多应用管理平台 |
|||
// +---------------------------------------------------------------------- |
|||
// | 官方网址:https://www.niucloud.com |
|||
// +---------------------------------------------------------------------- |
|||
// | niucloud团队 版权所有 开源版本可自由商用 |
|||
// +---------------------------------------------------------------------- |
|||
// | Author: Niucloud Team |
|||
// +---------------------------------------------------------------------- |
|||
|
|||
namespace app\adminapi\controller\market_performance; |
|||
|
|||
use core\base\BaseAdminController; |
|||
use app\service\admin\market_performance\MarketPerformanceService; |
|||
|
|||
|
|||
/** |
|||
* 市场绩效控制器 |
|||
* Class MarketPerformance |
|||
* @package app\adminapi\controller\market_performance |
|||
*/ |
|||
class MarketPerformance extends BaseAdminController |
|||
{ |
|||
/** |
|||
* 获取市场绩效列表 |
|||
* @return \think\Response |
|||
*/ |
|||
public function lists(){ |
|||
$data = $this->request->params([ |
|||
["campus_id",""], |
|||
["performance_amount",""] |
|||
]); |
|||
|
|||
return success((new MarketPerformanceService())->getPage($data)); |
|||
} |
|||
|
|||
/** |
|||
* 市场绩效详情 |
|||
* @param int $id |
|||
* @return \think\Response |
|||
*/ |
|||
public function info(int $id){ |
|||
return success((new MarketPerformanceService())->getInfo($id)); |
|||
} |
|||
|
|||
/** |
|||
* 添加市场绩效 |
|||
* @return \think\Response |
|||
*/ |
|||
public function add(){ |
|||
$data = $this->request->params([ |
|||
["personnel_id",0], |
|||
["campus_id",0], |
|||
["performance_amount",0.00], |
|||
|
|||
]); |
|||
$this->validate($data, 'app\validate\market_performance\MarketPerformance.add'); |
|||
$id = (new MarketPerformanceService())->add($data); |
|||
return success('ADD_SUCCESS', ['id' => $id]); |
|||
} |
|||
|
|||
/** |
|||
* 市场绩效编辑 |
|||
* @param $id 市场绩效id |
|||
* @return \think\Response |
|||
*/ |
|||
public function edit(int $id){ |
|||
$data = $this->request->params([ |
|||
["personnel_id",0], |
|||
["campus_id",0], |
|||
["performance_amount",0.00], |
|||
|
|||
]); |
|||
$this->validate($data, 'app\validate\market_performance\MarketPerformance.edit'); |
|||
(new MarketPerformanceService())->edit($id, $data); |
|||
return success('EDIT_SUCCESS'); |
|||
} |
|||
|
|||
/** |
|||
* 市场绩效删除 |
|||
* @param $id 市场绩效id |
|||
* @return \think\Response |
|||
*/ |
|||
public function del(int $id){ |
|||
(new MarketPerformanceService())->del($id); |
|||
return success('DELETE_SUCCESS'); |
|||
} |
|||
|
|||
|
|||
public function getPersonnelAll(){ |
|||
return success(( new MarketPerformanceService())->getPersonnelAll()); |
|||
} |
|||
|
|||
public function getCampusAll(){ |
|||
return success(( new MarketPerformanceService())->getCampusAll()); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,122 @@ |
|||
<?php |
|||
// +---------------------------------------------------------------------- |
|||
// | Niucloud-admin 企业快速开发的多应用管理平台 |
|||
// +---------------------------------------------------------------------- |
|||
// | 官方网址:https://www.niucloud.com |
|||
// +---------------------------------------------------------------------- |
|||
// | niucloud团队 版权所有 开源版本可自由商用 |
|||
// +---------------------------------------------------------------------- |
|||
// | Author: Niucloud Team |
|||
// +---------------------------------------------------------------------- |
|||
|
|||
use think\facade\Route; |
|||
|
|||
use app\adminapi\middleware\AdminCheckRole; |
|||
use app\adminapi\middleware\AdminCheckToken; |
|||
use app\adminapi\middleware\AdminLog; |
|||
// USER_CODE_BEGIN -- lesson_course_teaching |
|||
|
|||
Route::group('lesson_course_teaching', function () { |
|||
|
|||
//课程教学大纲列表 |
|||
Route::get('lesson_course_teaching', 'lesson_course_teaching.LessonCourseTeaching/lists'); |
|||
//添加课程教学大纲 |
|||
Route::post('lesson_course_teaching', 'lesson_course_teaching.LessonCourseTeaching/add'); |
|||
//编辑课程教学大纲 |
|||
Route::put('lesson_course_teaching/:id', 'lesson_course_teaching.LessonCourseTeaching/edit'); |
|||
|
|||
//跳绳教案库列表 |
|||
Route::get('jump_lesson_library', 'lesson_course_teaching.LessonCourseTeaching/jumpLists'); |
|||
//添加跳绳教案库 |
|||
Route::post('jump_lesson_library', 'lesson_course_teaching.LessonCourseTeaching/jumpAdd'); |
|||
//编辑跳绳教案库 |
|||
Route::put('jump_lesson_library/:id', 'lesson_course_teaching.LessonCourseTeaching/jumpEdit'); |
|||
|
|||
//高数教案库列表 |
|||
Route::get('en_teaching_library', 'lesson_course_teaching.LessonCourseTeaching/enLists'); |
|||
//添加高数教案库 |
|||
Route::post('en_teaching_library', 'lesson_course_teaching.LessonCourseTeaching/enAdd'); |
|||
//编辑高数教案库 |
|||
Route::put('en_teaching_library/:id', 'lesson_course_teaching.LessonCourseTeaching/enEdit'); |
|||
|
|||
//篮球教案库列表 |
|||
Route::get('basketball_teaching_library', 'lesson_course_teaching.LessonCourseTeaching/basketballLists'); |
|||
//添加篮球教案库 |
|||
Route::post('basketball_teaching_library', 'lesson_course_teaching.LessonCourseTeaching/basketballAdd'); |
|||
//编辑篮球教案库 |
|||
Route::put('basketball_teaching_library/:id', 'lesson_course_teaching.LessonCourseTeaching/basketballEdit'); |
|||
|
|||
//强化教案库列表 |
|||
Route::get('streng_teaching_library', 'lesson_course_teaching.LessonCourseTeaching/strengLists'); |
|||
//添加强化教案库 |
|||
Route::post('streng_teaching_library', 'lesson_course_teaching.LessonCourseTeaching/strengAdd'); |
|||
//编辑强化教案库 |
|||
Route::put('streng_teaching_library/:id', 'lesson_course_teaching.LessonCourseTeaching/strengEdit'); |
|||
|
|||
//空中忍者教案库列表 |
|||
Route::get('ninja_teaching_library', 'lesson_course_teaching.LessonCourseTeaching/ninjaLists'); |
|||
//添加空中忍者教案库 |
|||
Route::post('ninja_teaching_library', 'lesson_course_teaching.LessonCourseTeaching/ninjaAdd'); |
|||
//编辑空中忍者教案库 |
|||
Route::put('ninja_teaching_library/:id', 'lesson_course_teaching.LessonCourseTeaching/ninjaEdit'); |
|||
|
|||
//少儿安防教案库列表 |
|||
Route::get('security_teaching_library', 'lesson_course_teaching.LessonCourseTeaching/securityLists'); |
|||
//添加少儿安防教案库 |
|||
Route::post('security_teaching_library', 'lesson_course_teaching.LessonCourseTeaching/securityAdd'); |
|||
//编辑少儿安防教案库 |
|||
Route::put('security_teaching_library/:id', 'lesson_course_teaching.LessonCourseTeaching/securityEdit'); |
|||
|
|||
//体能教案库列表 |
|||
Route::get('physical_teaching_library', 'lesson_course_teaching.LessonCourseTeaching/physicalLists'); |
|||
//添加体能教案库 |
|||
Route::post('physical_teaching_library', 'lesson_course_teaching.LessonCourseTeaching/physicalAdd'); |
|||
//编辑体能教案库 |
|||
Route::put('physical_teaching_library/:id', 'lesson_course_teaching.LessonCourseTeaching/physicalEdit'); |
|||
|
|||
//热身动作列表 |
|||
Route::get('action_library', 'lesson_course_teaching.LessonCourseTeaching/actionLists'); |
|||
//添加热身动作库 |
|||
Route::post('action_library', 'lesson_course_teaching.LessonCourseTeaching/actionAdd'); |
|||
//编辑热身动作库 |
|||
Route::put('action_library/:id', 'lesson_course_teaching.LessonCourseTeaching/actionEdit'); |
|||
|
|||
//体能动作列表 |
|||
Route::get('fitness_library', 'lesson_course_teaching.LessonCourseTeaching/fitnessLists'); |
|||
//添加体能动作 |
|||
Route::post('fitness_library', 'lesson_course_teaching.LessonCourseTeaching/fitnessAdd'); |
|||
//编辑体能动作 |
|||
Route::put('fitness_library/:id', 'lesson_course_teaching.LessonCourseTeaching/fitnessEdit'); |
|||
|
|||
//趣味游戏列表 |
|||
Route::get('games_library', 'lesson_course_teaching.LessonCourseTeaching/gamesLists'); |
|||
//趣味游戏动作 |
|||
Route::post('games_library', 'lesson_course_teaching.LessonCourseTeaching/gamesAdd'); |
|||
//趣味游戏动作 |
|||
Route::put('games_library/:id', 'lesson_course_teaching.LessonCourseTeaching/gamesEdit'); |
|||
|
|||
//放松游戏列表 |
|||
Route::get('relaxation_library', 'lesson_course_teaching.LessonCourseTeaching/relaxationLists'); |
|||
//放松游戏 |
|||
Route::post('relaxation_library', 'lesson_course_teaching.LessonCourseTeaching/relaxationAdd'); |
|||
//放松游戏 |
|||
Route::put('relaxation_library/:id', 'lesson_course_teaching.LessonCourseTeaching/relaxationEdit'); |
|||
|
|||
|
|||
Route::get('public_library', 'lesson_course_teaching.LessonCourseTeaching/publicLists'); |
|||
Route::post('public_library', 'lesson_course_teaching.LessonCourseTeaching/publicAdd'); |
|||
Route::put('public_library/:id', 'lesson_course_teaching.LessonCourseTeaching/publicEdit'); |
|||
|
|||
//教研管理详情 |
|||
Route::get('lesson_course_teaching/:id', 'lesson_course_teaching.LessonCourseTeaching/info'); |
|||
//删除教研管理 |
|||
Route::delete('lesson_course_teaching/:id', 'lesson_course_teaching.LessonCourseTeaching/del'); |
|||
|
|||
Route::get('personnel_data_all','lesson_course_teaching.LessonCourseTeaching/getPersonnelDataAll'); |
|||
|
|||
})->middleware([ |
|||
AdminCheckToken::class, |
|||
AdminCheckRole::class, |
|||
AdminLog::class |
|||
]); |
|||
// USER_CODE_END -- lesson_course_teaching |
|||
@ -0,0 +1,41 @@ |
|||
<?php |
|||
// +---------------------------------------------------------------------- |
|||
// | Niucloud-admin 企业快速开发的多应用管理平台 |
|||
// +---------------------------------------------------------------------- |
|||
// | 官方网址:https://www.niucloud.com |
|||
// +---------------------------------------------------------------------- |
|||
// | niucloud团队 版权所有 开源版本可自由商用 |
|||
// +---------------------------------------------------------------------- |
|||
// | Author: Niucloud Team |
|||
// +---------------------------------------------------------------------- |
|||
|
|||
use think\facade\Route; |
|||
|
|||
use app\adminapi\middleware\AdminCheckRole; |
|||
use app\adminapi\middleware\AdminCheckToken; |
|||
use app\adminapi\middleware\AdminLog; |
|||
// USER_CODE_BEGIN -- market_performance |
|||
|
|||
Route::group('market_performance', function () { |
|||
|
|||
//市场绩效列表 |
|||
Route::get('market_performance', 'market_performance.MarketPerformance/lists'); |
|||
//市场绩效详情 |
|||
Route::get('market_performance/:id', 'market_performance.MarketPerformance/info'); |
|||
//添加市场绩效 |
|||
Route::post('market_performance', 'market_performance.MarketPerformance/add'); |
|||
//编辑市场绩效 |
|||
Route::put('market_performance/:id', 'market_performance.MarketPerformance/edit'); |
|||
//删除市场绩效 |
|||
Route::delete('market_performance/:id', 'market_performance.MarketPerformance/del'); |
|||
|
|||
Route::get('personnel_all','market_performance.MarketPerformance/getPersonnelAll'); |
|||
|
|||
Route::get('campus_all','market_performance.MarketPerformance/getCampusAll'); |
|||
|
|||
})->middleware([ |
|||
AdminCheckToken::class, |
|||
AdminCheckRole::class, |
|||
AdminLog::class |
|||
]); |
|||
// USER_CODE_END -- market_performance |
|||
@ -0,0 +1,124 @@ |
|||
<?php |
|||
// +---------------------------------------------------------------------- |
|||
// | Niucloud-admin 企业快速开发的多应用管理平台 |
|||
// +---------------------------------------------------------------------- |
|||
// | 官方网址:https://www.niucloud.com |
|||
// +---------------------------------------------------------------------- |
|||
// | niucloud团队 版权所有 开源版本可自由商用 |
|||
// +---------------------------------------------------------------------- |
|||
// | Author: Niucloud Team |
|||
// +---------------------------------------------------------------------- |
|||
|
|||
namespace app\model\lesson_course_teaching; |
|||
|
|||
use core\base\BaseModel; |
|||
use think\model\concern\SoftDelete; |
|||
use think\model\relation\HasMany; |
|||
use think\model\relation\HasOne; |
|||
|
|||
use app\model\personnel_data\PersonnelData; |
|||
|
|||
/** |
|||
* 教研管理模型 |
|||
* Class LessonCourseTeaching |
|||
* @package app\model\lesson_course_teaching |
|||
*/ |
|||
class LessonCourseTeaching extends BaseModel |
|||
{ |
|||
|
|||
use SoftDelete; |
|||
|
|||
/** |
|||
* 数据表主键 |
|||
* @var string |
|||
*/ |
|||
protected $pk = 'id'; |
|||
|
|||
/** |
|||
* 模型名称 |
|||
* @var string |
|||
*/ |
|||
protected $name = 'lesson_course_teaching'; |
|||
|
|||
/** |
|||
* 定义软删除标记字段. |
|||
* @var string |
|||
*/ |
|||
protected $deleteTime = 'delete_time'; |
|||
|
|||
/** |
|||
* 定义软删除字段的默认值. |
|||
* @var int |
|||
*/ |
|||
protected $defaultSoftDelete = 0; |
|||
|
|||
/** |
|||
* 搜索器:教研管理课程标题 |
|||
* @param $value |
|||
* @param $data |
|||
*/ |
|||
public function searchTitleAttr($query, $value, $data) |
|||
{ |
|||
if ($value) { |
|||
$query->where("title", "like", "%".$value."%"); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 搜索器:教研管理状态 |
|||
* @param $value |
|||
* @param $data |
|||
*/ |
|||
public function searchStatusAttr($query, $value, $data) |
|||
{ |
|||
if ($value) { |
|||
$query->where("status", $value); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 搜索器:教研管理创建时间 |
|||
* @param $value |
|||
* @param $data |
|||
*/ |
|||
public function searchCreateTimeAttr($query, $value, $data) |
|||
{ |
|||
$start = empty($value[0]) ? 0 : strtotime($value[0]); |
|||
$end = empty($value[1]) ? 0 : strtotime($value[1]); |
|||
if ($start > 0 && $end > 0) { |
|||
$query->where([["create_time", "between", [$start, $end]]]); |
|||
} else if ($start > 0 && $end == 0) { |
|||
$query->where([["create_time", ">=", $start]]); |
|||
} else if ($start == 0 && $end > 0) { |
|||
$query->where([["create_time", "<=", $end]]); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 搜索器:教研管理修改时间 |
|||
* @param $value |
|||
* @param $data |
|||
*/ |
|||
public function searchUpdateTimeAttr($query, $value, $data) |
|||
{ |
|||
$start = empty($value[0]) ? 0 : strtotime($value[0]); |
|||
$end = empty($value[1]) ? 0 : strtotime($value[1]); |
|||
if ($start > 0 && $end > 0) { |
|||
$query->where([["update_time", "between", [$start, $end]]]); |
|||
} else if ($start > 0 && $end == 0) { |
|||
$query->where([["update_time", ">=", $start]]); |
|||
} else if ($start == 0 && $end > 0) { |
|||
$query->where([["update_time", "<=", $end]]); |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
public function personnelData(){ |
|||
return $this->hasOne(PersonnelData::class, 'sys_user_id', 'user_permission')->joinType('left')->withField('name,sys_user_id')->bind(['user_permission_name'=>'name']); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,86 @@ |
|||
<?php |
|||
// +---------------------------------------------------------------------- |
|||
// | Niucloud-admin 企业快速开发的多应用管理平台 |
|||
// +---------------------------------------------------------------------- |
|||
// | 官方网址:https://www.niucloud.com |
|||
// +---------------------------------------------------------------------- |
|||
// | niucloud团队 版权所有 开源版本可自由商用 |
|||
// +---------------------------------------------------------------------- |
|||
// | Author: Niucloud Team |
|||
// +---------------------------------------------------------------------- |
|||
|
|||
namespace app\model\market_performance; |
|||
|
|||
use core\base\BaseModel; |
|||
use think\model\concern\SoftDelete; |
|||
use think\model\relation\HasMany; |
|||
use think\model\relation\HasOne; |
|||
|
|||
use app\model\personnel\Personnel; |
|||
|
|||
use app\model\campus\Campus; |
|||
|
|||
/** |
|||
* 市场绩效模型 |
|||
* Class MarketPerformance |
|||
* @package app\model\market_performance |
|||
*/ |
|||
class MarketPerformance extends BaseModel |
|||
{ |
|||
|
|||
|
|||
|
|||
/** |
|||
* 数据表主键 |
|||
* @var string |
|||
*/ |
|||
protected $pk = 'id'; |
|||
|
|||
/** |
|||
* 模型名称 |
|||
* @var string |
|||
*/ |
|||
protected $name = 'market_performance'; |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
/** |
|||
* 搜索器:市场绩效校区 |
|||
* @param $value |
|||
* @param $data |
|||
*/ |
|||
public function searchCampusIdAttr($query, $value, $data) |
|||
{ |
|||
if ($value) { |
|||
$query->where("campus_id", $value); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 搜索器:市场绩效绩效金额 |
|||
* @param $value |
|||
* @param $data |
|||
*/ |
|||
public function searchPerformanceAmountAttr($query, $value, $data) |
|||
{ |
|||
if ($value) { |
|||
$query->where("performance_amount", $value); |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
public function personnel(){ |
|||
return $this->hasOne(Personnel::class, 'id', 'personnel_id')->joinType('left')->withField('name,id')->bind(['personnel_id_name'=>'name']); |
|||
} |
|||
|
|||
public function campus(){ |
|||
return $this->hasOne(Campus::class, 'id', 'campus_id')->joinType('left')->withField('campus_name,id')->bind(['campus_id_name'=>'campus_name']); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,55 @@ |
|||
<?php |
|||
// +---------------------------------------------------------------------- |
|||
// | Niucloud-admin 企业快速开发的多应用管理平台 |
|||
// +---------------------------------------------------------------------- |
|||
// | 官方网址:https://www.niucloud.com |
|||
// +---------------------------------------------------------------------- |
|||
// | niucloud团队 版权所有 开源版本可自由商用 |
|||
// +---------------------------------------------------------------------- |
|||
// | Author: Niucloud Team |
|||
// +---------------------------------------------------------------------- |
|||
|
|||
namespace app\model\personnel_data; |
|||
|
|||
use core\base\BaseModel; |
|||
use think\model\concern\SoftDelete; |
|||
use think\model\relation\HasMany; |
|||
use think\model\relation\HasOne; |
|||
|
|||
/** |
|||
* 课程教学大纲模型 |
|||
* Class LessonCourseTeaching |
|||
* @package app\model\lesson_course_teaching |
|||
*/ |
|||
class PersonnelData extends BaseModel |
|||
{ |
|||
|
|||
use SoftDelete; |
|||
|
|||
/** |
|||
* 数据表主键 |
|||
* @var string |
|||
*/ |
|||
protected $pk = 'id'; |
|||
|
|||
/** |
|||
* 模型名称 |
|||
* @var string |
|||
*/ |
|||
protected $name = 'personnel'; |
|||
|
|||
/** |
|||
* 定义软删除标记字段. |
|||
* @var string |
|||
*/ |
|||
protected $deleteTime = 'delete_time'; |
|||
|
|||
/** |
|||
* 定义软删除字段的默认值. |
|||
* @var int |
|||
*/ |
|||
protected $defaultSoftDelete = 0; |
|||
|
|||
|
|||
} |
|||
|
|||
@ -0,0 +1,634 @@ |
|||
<?php |
|||
// +---------------------------------------------------------------------- |
|||
// | Niucloud-admin 企业快速开发的多应用管理平台 |
|||
// +---------------------------------------------------------------------- |
|||
// | 官方网址:https://www.niucloud.com |
|||
// +---------------------------------------------------------------------- |
|||
// | niucloud团队 版权所有 开源版本可自由商用 |
|||
// +---------------------------------------------------------------------- |
|||
// | Author: Niucloud Team |
|||
// +---------------------------------------------------------------------- |
|||
|
|||
namespace app\service\admin\lesson_course_teaching; |
|||
|
|||
use app\model\lesson_course_teaching\LessonCourseTeaching; |
|||
use app\model\personnel_data\PersonnelData; |
|||
|
|||
use core\base\BaseAdminService; |
|||
|
|||
|
|||
/** |
|||
* 教研管理服务层 |
|||
* Class LessonCourseTeachingService |
|||
* @package app\service\admin\lesson_course_teaching |
|||
*/ |
|||
class LessonCourseTeachingService extends BaseAdminService |
|||
{ |
|||
public function __construct() |
|||
{ |
|||
parent::__construct(); |
|||
$this->model = new LessonCourseTeaching(); |
|||
} |
|||
|
|||
/** |
|||
* 获取课程教学大纲列表 |
|||
* @param array $where |
|||
* @return array |
|||
*/ |
|||
public function getPage(array $where = []) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
$order = 'id desc'; |
|||
|
|||
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 添加课程教学大纲 |
|||
* @param array $data |
|||
* @return mixed |
|||
*/ |
|||
public function add(array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 课程教学大纲编辑 |
|||
* @param int $id |
|||
* @param array $data |
|||
* @return bool |
|||
*/ |
|||
public function edit(int $id, array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取跳绳教案库列表 |
|||
* @param array $where |
|||
* @return array |
|||
*/ |
|||
public function jumpPetPage(array $where = []) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
$order = 'id desc'; |
|||
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
|
|||
/** |
|||
* 添加跳绳教案库 |
|||
* @param array $data |
|||
* @return mixed |
|||
*/ |
|||
public function jumpAdd(array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 跳绳教案库编辑 |
|||
* @param int $id |
|||
* @param array $data |
|||
* @return bool |
|||
*/ |
|||
public function jumpEdit(int $id, array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
/** |
|||
* 获取增高教案库列表 |
|||
* @param array $where |
|||
* @return array |
|||
*/ |
|||
public function enPetPage(array $where = []) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
$order = 'id desc'; |
|||
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
|
|||
/** |
|||
* 添加增高教案库 |
|||
* @param array $data |
|||
* @return mixed |
|||
*/ |
|||
public function enAdd(array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 跳绳增高教案库 |
|||
* @param int $id |
|||
* @param array $data |
|||
* @return bool |
|||
*/ |
|||
public function enEdit(int $id, array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取跳高教案库列表 |
|||
* @param array $where |
|||
* @return array |
|||
*/ |
|||
public function basketballPetPage(array $where = []) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
$order = 'id desc'; |
|||
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
|
|||
/** |
|||
* 添加跳高教案库 |
|||
* @param array $data |
|||
* @return mixed |
|||
*/ |
|||
public function basketballAdd(array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 跳绳跳高教案库 |
|||
* @param int $id |
|||
* @param array $data |
|||
* @return bool |
|||
*/ |
|||
public function basketballEdit(int $id, array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
/** |
|||
* 获取跳高教案库列表 |
|||
* @param array $where |
|||
* @return array |
|||
*/ |
|||
public function strengPetPage(array $where = []) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
$order = 'id desc'; |
|||
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
|
|||
/** |
|||
* 添加跳高教案库 |
|||
* @param array $data |
|||
* @return mixed |
|||
*/ |
|||
public function strengAdd(array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 跳绳跳高教案库 |
|||
* @param int $id |
|||
* @param array $data |
|||
* @return bool |
|||
*/ |
|||
public function strengEdit(int $id, array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
/** |
|||
* 获取跳高教案库列表 |
|||
* @param array $where |
|||
* @return array |
|||
*/ |
|||
public function ninjaPetPage(array $where = []) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
$order = 'id desc'; |
|||
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
|
|||
/** |
|||
* 添加跳高教案库 |
|||
* @param array $data |
|||
* @return mixed |
|||
*/ |
|||
public function ninjaAdd(array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 跳绳跳高教案库 |
|||
* @param int $id |
|||
* @param array $data |
|||
* @return bool |
|||
*/ |
|||
public function ninjaEdit(int $id, array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
/** |
|||
* 获取跳高教案库列表 |
|||
* @param array $where |
|||
* @return array |
|||
*/ |
|||
public function securityPetPage(array $where = []) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
$order = 'id desc'; |
|||
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
|
|||
/** |
|||
* 添加跳高教案库 |
|||
* @param array $data |
|||
* @return mixed |
|||
*/ |
|||
public function securityAdd(array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 跳绳跳高教案库 |
|||
* @param int $id |
|||
* @param array $data |
|||
* @return bool |
|||
*/ |
|||
public function securityEdit(int $id, array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
/** |
|||
* 获取体能教案库列表 |
|||
* @param array $where |
|||
* @return array |
|||
*/ |
|||
public function physicalPetPage(array $where = []) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
$order = 'id desc'; |
|||
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
|
|||
/** |
|||
* 添加体能教案库 |
|||
* @param array $data |
|||
* @return mixed |
|||
*/ |
|||
public function physicalAdd(array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 跳绳体能教案库 |
|||
* @param int $id |
|||
* @param array $data |
|||
* @return bool |
|||
*/ |
|||
public function physicalEdit(int $id, array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
/** |
|||
* 获取热身动做列表 |
|||
* @param array $where |
|||
* @return array |
|||
*/ |
|||
public function actionPetPage(array $where = []) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
$order = 'id desc'; |
|||
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
|
|||
/** |
|||
* 添加热身动做 |
|||
* @param array $data |
|||
* @return mixed |
|||
*/ |
|||
public function actionAdd(array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 热身动做 |
|||
* @param int $id |
|||
* @param array $data |
|||
* @return bool |
|||
*/ |
|||
public function actionEdit(int $id, array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取趣味游戏列表 |
|||
* @param array $where |
|||
* @return array |
|||
*/ |
|||
public function gamesPetPage(array $where = []) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
$order = 'id desc'; |
|||
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
|
|||
/** |
|||
* 添加趣味游戏 |
|||
* @param array $data |
|||
* @return mixed |
|||
*/ |
|||
public function gamesAdd(array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 趣味游戏 |
|||
* @param int $id |
|||
* @param array $data |
|||
* @return bool |
|||
*/ |
|||
public function gamesEdit(int $id, array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* 获取趣味游戏列表 |
|||
* @param array $where |
|||
* @return array |
|||
*/ |
|||
public function fitnessPetPage(array $where = []) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
$order = 'id desc'; |
|||
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
|
|||
/** |
|||
* 添加趣味游戏 |
|||
* @param array $data |
|||
* @return mixed |
|||
*/ |
|||
public function fitnessAdd(array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 趣味游戏 |
|||
* @param int $id |
|||
* @param array $data |
|||
* @return bool |
|||
*/ |
|||
public function fitnessEdit(int $id, array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取趣味游戏列表 |
|||
* @param array $where |
|||
* @return array |
|||
*/ |
|||
public function relaxationPetPage(array $where = []) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
$order = 'id desc'; |
|||
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
|
|||
/** |
|||
* 添加趣味游戏 |
|||
* @param array $data |
|||
* @return mixed |
|||
*/ |
|||
public function relaxationAdd(array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 趣味游戏 |
|||
* @param int $id |
|||
* @param array $data |
|||
* @return bool |
|||
*/ |
|||
public function relaxationEdit(int $id, array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
|
|||
public function publicPetPage(array $where = []) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
$order = 'id desc'; |
|||
$search_model = $this->model->withSearch(["title","status","create_time","update_time","table_type"], $where)->with(['personnelData'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
public function publicAdd(array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
public function publicEdit(int $id, array $data) |
|||
{ |
|||
if (isset($data['user_permission']) && is_array($data['user_permission'])) { |
|||
$data['user_permission'] = implode(',', $data['user_permission']); |
|||
} |
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取教研管理信息 |
|||
* @param int $id |
|||
* @return array |
|||
*/ |
|||
public function getInfo(int $id) |
|||
{ |
|||
$field = 'id,title,image,type,content,status,create_time,update_time,delete_time,table_type,user_permission'; |
|||
|
|||
$info = $this->model->field($field)->where([['id', "=", $id]])->with(['personnelData'])->findOrEmpty()->toArray(); |
|||
$info['status'] = strval($info['status']); |
|||
return $info; |
|||
} |
|||
|
|||
/** |
|||
* 删除教研管理 |
|||
* @param int $id |
|||
* @return bool |
|||
*/ |
|||
public function del(int $id) |
|||
{ |
|||
$model = $this->model->where([['id', '=', $id]])->find(); |
|||
$res = $model->delete(); |
|||
return $res; |
|||
} |
|||
|
|||
|
|||
public function getPersonnelDataAll(){ |
|||
$personnelDataModel = new PersonnelData(); |
|||
return $personnelDataModel->where('is_sys_user',1)->select()->toArray(); |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,111 @@ |
|||
<?php |
|||
// +---------------------------------------------------------------------- |
|||
// | Niucloud-admin 企业快速开发的多应用管理平台 |
|||
// +---------------------------------------------------------------------- |
|||
// | 官方网址:https://www.niucloud.com |
|||
// +---------------------------------------------------------------------- |
|||
// | niucloud团队 版权所有 开源版本可自由商用 |
|||
// +---------------------------------------------------------------------- |
|||
// | Author: Niucloud Team |
|||
// +---------------------------------------------------------------------- |
|||
|
|||
namespace app\service\admin\market_performance; |
|||
|
|||
use app\model\market_performance\MarketPerformance; |
|||
use app\model\personnel\Personnel; |
|||
use app\model\campus\Campus; |
|||
|
|||
use core\base\BaseAdminService; |
|||
|
|||
|
|||
/** |
|||
* 市场绩效服务层 |
|||
* Class MarketPerformanceService |
|||
* @package app\service\admin\market_performance |
|||
*/ |
|||
class MarketPerformanceService extends BaseAdminService |
|||
{ |
|||
public function __construct() |
|||
{ |
|||
parent::__construct(); |
|||
$this->model = new MarketPerformance(); |
|||
} |
|||
|
|||
/** |
|||
* 获取市场绩效列表 |
|||
* @param array $where |
|||
* @return array |
|||
*/ |
|||
public function getPage(array $where = []) |
|||
{ |
|||
$field = 'id,personnel_id,campus_id,performance_amount,resource_count,performance_date,performance_config,performance_algorithm,status,created_at,updated_at'; |
|||
$order = 'id desc'; |
|||
|
|||
$search_model = $this->model->where(get_campus_where($this->uid))->withSearch(["campus_id","performance_amount"], $where)->with(['personnel','campus'])->field($field)->order($order); |
|||
$list = $this->pageQuery($search_model); |
|||
return $list; |
|||
} |
|||
|
|||
/** |
|||
* 获取市场绩效信息 |
|||
* @param int $id |
|||
* @return array |
|||
*/ |
|||
public function getInfo(int $id) |
|||
{ |
|||
$field = 'id,personnel_id,campus_id,performance_amount,resource_count,performance_date,performance_config,performance_algorithm,status,created_at,updated_at'; |
|||
|
|||
$info = $this->model->field($field)->where([['id', "=", $id]])->with(['personnel','campus'])->findOrEmpty()->toArray(); |
|||
return $info; |
|||
} |
|||
|
|||
/** |
|||
* 添加市场绩效 |
|||
* @param array $data |
|||
* @return mixed |
|||
*/ |
|||
public function add(array $data) |
|||
{ |
|||
$res = $this->model->create($data); |
|||
return $res->id; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 市场绩效编辑 |
|||
* @param int $id |
|||
* @param array $data |
|||
* @return bool |
|||
*/ |
|||
public function edit(int $id, array $data) |
|||
{ |
|||
|
|||
$this->model->where([['id', '=', $id]])->update($data); |
|||
return true; |
|||
} |
|||
|
|||
/** |
|||
* 删除市场绩效 |
|||
* @param int $id |
|||
* @return bool |
|||
*/ |
|||
public function del(int $id) |
|||
{ |
|||
$model = $this->model->where([['id', '=', $id]])->find(); |
|||
$res = $model->delete(); |
|||
return $res; |
|||
} |
|||
|
|||
|
|||
public function getPersonnelAll(){ |
|||
$personnelModel = new Personnel(); |
|||
return $personnelModel->select()->toArray(); |
|||
} |
|||
|
|||
public function getCampusAll(){ |
|||
$campusModel = new Campus(); |
|||
return $campusModel->select()->toArray(); |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
<?php |
|||
// +---------------------------------------------------------------------- |
|||
// | Niucloud-admin 企业快速开发的多应用管理平台 |
|||
// +---------------------------------------------------------------------- |
|||
// | 官方网址:https://www.niucloud.com |
|||
// +---------------------------------------------------------------------- |
|||
// | niucloud团队 版权所有 开源版本可自由商用 |
|||
// +---------------------------------------------------------------------- |
|||
// | Author: Niucloud Team |
|||
// +---------------------------------------------------------------------- |
|||
|
|||
namespace app\validate\lesson_course_teaching; |
|||
use core\base\BaseValidate; |
|||
/** |
|||
* 课程教学大纲验证器 |
|||
* Class LessonCourseTeaching |
|||
* @package addon\app\validate\lesson_course_teaching |
|||
*/ |
|||
class LessonCourseTeaching extends BaseValidate |
|||
{ |
|||
|
|||
protected $rule = [ |
|||
|
|||
]; |
|||
|
|||
protected $message = [ |
|||
|
|||
]; |
|||
|
|||
protected $scene = [ |
|||
"add" => ['title', 'image', 'type', 'content', 'status'], |
|||
"edit" => ['title', 'image', 'type', 'content', 'status'] |
|||
]; |
|||
|
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
<?php |
|||
// +---------------------------------------------------------------------- |
|||
// | Niucloud-admin 企业快速开发的多应用管理平台 |
|||
// +---------------------------------------------------------------------- |
|||
// | 官方网址:https://www.niucloud.com |
|||
// +---------------------------------------------------------------------- |
|||
// | niucloud团队 版权所有 开源版本可自由商用 |
|||
// +---------------------------------------------------------------------- |
|||
// | Author: Niucloud Team |
|||
// +---------------------------------------------------------------------- |
|||
|
|||
namespace app\validate\market_performance; |
|||
use core\base\BaseValidate; |
|||
/** |
|||
* 市场绩效验证器 |
|||
* Class MarketPerformance |
|||
* @package addon\app\validate\market_performance |
|||
*/ |
|||
class MarketPerformance extends BaseValidate |
|||
{ |
|||
|
|||
protected $rule = [ |
|||
|
|||
]; |
|||
|
|||
protected $message = [ |
|||
|
|||
]; |
|||
|
|||
protected $scene = [ |
|||
"add" => ['personnel_id', 'campus_id', 'performance_amount'], |
|||
"edit" => ['personnel_id', 'campus_id', 'performance_amount'] |
|||
]; |
|||
|
|||
} |
|||
Loading…
Reference in new issue