123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- /**
- *
- *User:Administrator
- *Date:2021/10/13
- */
- namespace app\api\model;
- use think\Model;
- class Undertake extends Model
- {
- public function insert(array $data = [], bool $getLastInsID = false)
- {
- return parent::insert($data, $getLastInsID); // TODO: Change the autogenerated stub
- }
- public function deleteInfoByID($id_arr)
- {
- return $this->select($id_arr)->delete();
- }
- public function selectTaskListByTaskIdAndUid($task_id,$unit_id='',$bear_id='',$report_id='',$pageNum=1,$pageSize=null)
- {
- $where=[
- ['task_id', '=', $task_id],
- ];
- if ($unit_id!='') {
- array_push($where, ['unit_id', '=', $unit_id]);
- }
- if ($bear_id!='') {
- array_push($where, ['bear_id', '=', $bear_id]);
- }
- if ($report_id!='') {
- array_push($where,['report_id', '=', $report_id]);
- }
- return $this->where($where)->page($pageNum,$pageSize)->select();
- }
- public function countTaskListByTaskIdAndUid($task_id,$unit_id='',$bear_id='',$report_id='')
- {
- $where=[
- ['task_id', '=', $task_id],
- ];
- if ($unit_id != '') {
- array_push($where, ['unit_id', '=', $unit_id]);
- }
- if ($bear_id != '') {
- array_push($where, ['bear_id', '=', $bear_id]);
- }
- if ($report_id != '') {
- array_push($where,['report_id', '=', $report_id]);
- }
- return $this->where($where)->count();
- }
- }
|