<?php
namespace app\admin\model;
use think\Model;
class Worker extends Model
{
public function WorkerListModel($key,$domain,$page,$pagesize){
$field = ['*'];
$list = $this->alias('w')
->where('domain','=',$domain)
->field($field)
->paginate([
'list_rows'=> $pagesize,
'var_page' => 'page',
'page'=>$page
])->each(function($item, $key){
$item['birthday'] = date('Y-m-d',$item['birthday']);
return $item;
});
return $list;
}
public function WorkerInsertModel($ProjectInfo){
return $this->insertGetId($ProjectInfo);
}
public function WorkerSaveModel($projectid,$ProjectInfo){
$where[] = ['id','=',$projectid];
$res = $this->where($where)->save($ProjectInfo);
return $res;
}
public function WorkerDisableEableModel($projectid){
$where[] = ['id','=',$projectid];
$data['status'] = -1;
$res = $this->where($where)->save($data);
return $res;
}
public function WorkerdelModel($projectid){
$where[] = ['id','=',$projectid];
$res = $this->where($where)->delete();
return $res;
}
}