123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- /**
- * Created by PhpStorm.
- * User: sicilon_IT
- * Date: 2020/1/13
- * Time: 15:37
- */
- namespace app\index\model;
- use think\Model;
- class ginfomodel extends Model{
- protected $table='t_ginfo';
- public function getpidbygid($gid){
- $record=$this->where('id',$gid)->find();
- if (empty($record)){
- return 0;
- }else{
- return $record['pid'];
- }
- }
- public function addnewgroup($arr){
- $res=$this->save($arr);
- return $res;
- }
- public function getglistbypid($pid){
- $rlist=$this->where('pid',$pid)->select();
- return $rlist;
- }
- /*
- * 20200310
- * 获取班组名称
- */
- public function selginfobygid($gid){
- $rec=$this->where('id',$gid)->find();
- return $rec;
- }
- /*
- * 20200331
- * 更新班组名称
- */
- public function updatenamebyid($arr){
- $where_arr['id']=$arr['id'];
- $updatearr['gname']=$arr['gname'];
- $updatearr['gworkclass']=$arr['gworkclass'];
- $rid=$this->where($where_arr)->update($updatearr);
- return $rid;
- }
- }
|