添加网站文件
This commit is contained in:
690
application/admin/controller/Staff.php
Normal file
690
application/admin/controller/Staff.php
Normal file
@@ -0,0 +1,690 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
use think\Db;
|
||||
use app\admin\logic\StaffLogic;
|
||||
use app\admin\logic\RoleLogic;
|
||||
use app\admin\logic\UserLogic;
|
||||
use app\common\server\UrlServer;
|
||||
use app\common\server\ConfigServer;
|
||||
use think\facade\Hook;
|
||||
|
||||
class Staff extends AdminBase
|
||||
{
|
||||
|
||||
/**
|
||||
* 员工的列表
|
||||
* @param 杨左
|
||||
* @param 哆啦猫家政
|
||||
*/
|
||||
public function lists(){ //显示列表
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = StaffLogic::lists($get);
|
||||
$this->_success('',$lists);
|
||||
}
|
||||
$grouping=Db::name('staff_grouping')->select();
|
||||
$this->assign('grouping',$grouping);
|
||||
$this->assign('usertype',StaffLogic::staff_beed());
|
||||
$this->assign('type',StaffLogic::type());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 员工列表的分组
|
||||
* @param 杨左
|
||||
* @param 哆啦猫家政
|
||||
*/
|
||||
public function staff_bellist(){
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = StaffLogic::staff_bellistgoic($get);
|
||||
$this->_success('',$lists);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function getList(){
|
||||
$post = $this->request->get('');
|
||||
// $list = StaffLogic::getList($post);
|
||||
$this->_success('');
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑员工分组
|
||||
* @param 杨左
|
||||
* @param 哆啦猫家政
|
||||
*/
|
||||
public function staff_beedit($id){
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->post();
|
||||
$get['auth_ids'] = implode(',', $get['auth_ids']);
|
||||
$lists = StaffLogic::staff_beedit($get);
|
||||
$this->_success('编辑成功');
|
||||
}
|
||||
|
||||
$this->assign('info', RoleLogic::staffroleInfo($id));
|
||||
$auth_tree = RoleLogic::staffauthTree($id);
|
||||
$this->assign('auth_tree', json_encode($auth_tree));
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* 增加员工分组
|
||||
* @param 杨左
|
||||
* @param 哆啦猫家政
|
||||
*/
|
||||
public function staff_beeadd(){
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->post();
|
||||
$lists = StaffLogic::staff_beeadd($get);
|
||||
|
||||
$this->_success('增加员工分组成功');
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
public function staff_beedel(){
|
||||
$id = $this->request->post('id');
|
||||
$lists = StaffLogic::staff_beedel($id);
|
||||
$this->_success('删除员工分组成功');
|
||||
}
|
||||
/**
|
||||
* 增加员工的类别
|
||||
* @param 杨左
|
||||
* @param 哆啦猫家政
|
||||
*/
|
||||
public function staff_typelist(){
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = StaffLogic::staff_typelist($get);
|
||||
$this->_success('',$lists);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* 增加员工的类别
|
||||
* @param 杨左
|
||||
* @param 哆啦猫家政
|
||||
*/
|
||||
public function staff_typeadd(){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$lists = StaffLogic::staff_typeadd($post);
|
||||
$this->_success('',$lists);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* 增加修改员工服务类别
|
||||
* @param 杨左
|
||||
* @param 哆啦猫家政
|
||||
*/
|
||||
public function staff_typeedit($id){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$lists = StaffLogic::staff_typeedit($post);
|
||||
$this->_success('修改类别成功');
|
||||
}
|
||||
$detail=Db::name('staff_type')->where('id',$id)->find();
|
||||
$this->assign('detail',$detail);
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* 删除员工服务类别
|
||||
* @param 杨左
|
||||
* @param 哆啦猫家政
|
||||
*/
|
||||
public function staff_typedel(){
|
||||
$id = $this->request->post('id');
|
||||
$lists = StaffLogic::staff_typedel($id);
|
||||
$this->_success('删除服务类别成功');
|
||||
}
|
||||
/**
|
||||
* 员工的档案
|
||||
* @param 杨左
|
||||
* @param 哆啦猫家政
|
||||
*/
|
||||
public function staffinfo($id){
|
||||
|
||||
if ($this->request->isAjax()) {
|
||||
$post= $this->request->post();
|
||||
$staff=Db::name('staff')->where('id',$post['id'])->find();
|
||||
if($post['money_handle']==1){
|
||||
$number=Db::name('staff')->where('id',$post['id'])->update(['number'=>$staff['number']+$post['money']]);
|
||||
$data=[
|
||||
'staff_id'=>$post['id'],
|
||||
'number'=>+$post['money'],
|
||||
'money_remark'=>$post['money_remark'],
|
||||
'time'=>time(),
|
||||
];
|
||||
$instr=Db::name('staff_jf')->data($data)->insert();
|
||||
$piont=[
|
||||
'staff_id'=>$post['id'],
|
||||
'type' =>1,
|
||||
'bdjf' =>$post['money'],
|
||||
'add_time'=>time(),
|
||||
'type_name'=>$post['money_remark']
|
||||
|
||||
];
|
||||
Db::name('staff_points')->data($piont)->insert();
|
||||
$staffsd=Db::name('staff')->where('id',$post['id'])->find();
|
||||
Db::name('staff')->where('id', $post['id'])->update([
|
||||
'state' => $staffsd['number'] >= 14 ? 0 : 1
|
||||
]);
|
||||
$this->_success('增加积分成功');
|
||||
}else if($post['money_handle']==0){
|
||||
$number=Db::name('staff')->where('id',$post['id'])->update(['number'=>$staff['number']-$post['money']]);
|
||||
$data=[
|
||||
'staff_id'=>$post['id'],
|
||||
'number'=>-$post['money'],
|
||||
'money_remark'=>$post['money_remark'],
|
||||
'time'=>time(),
|
||||
];
|
||||
$instr=Db::name('staff_jf')->data($data)->insert();
|
||||
$piont=[
|
||||
'staff_id'=>$post['id'],
|
||||
'type' =>0,
|
||||
'bdjf' =>$post['money'],
|
||||
'add_time'=>time(),
|
||||
'type_name'=>'后台操作'
|
||||
|
||||
];
|
||||
Db::name('staff_points')->data($piont)->insert();
|
||||
$staffsd=Db::name('staff')->where('id',$post['id'])->find();
|
||||
Db::name('staff')->where('id', $post['id'])->update([
|
||||
'state' => $staffsd['number'] < 14 ? 1 : 0
|
||||
]);
|
||||
|
||||
$this->_success('减少积分成功');
|
||||
}
|
||||
return $post;
|
||||
}
|
||||
$detail=Db::name('staff')->where('id',$id)->find();
|
||||
$this->assign('info',$detail);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加员工列表
|
||||
* @param 杨左
|
||||
* @param 哆啦猫家政
|
||||
*/
|
||||
|
||||
public function add(){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$lists = StaffLogic::add($post);
|
||||
$this->_success('增加员工成功',$lists);
|
||||
}
|
||||
$this->assign('brand_lists', json_encode(StaffLogic::staff_beed(), JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('category_lists', json_encode(StaffLogic::getAllTree(), JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('group_id',StaffLogic::staff_beed());
|
||||
$this->assign('type',StaffLogic::type());
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* 编辑员工列表
|
||||
* @param 杨左
|
||||
* @param 哆啦猫家政
|
||||
*/
|
||||
|
||||
public function edit(){
|
||||
if ($this->request->isAjax() && $this->request->isPost()) {
|
||||
$post= $this->request->post(); //接受传递过来的员工数据
|
||||
|
||||
|
||||
$lists =StaffLogic::edits($post);
|
||||
$this->_success('修改员工数据成功',$lists);
|
||||
}
|
||||
$id = $this->request->get('id');
|
||||
$infos=Db::name('staff')->where('id',$id)->find();
|
||||
$this->assign('info', json_encode(StaffLogic::info($id),JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('brand_lists', json_encode(StaffLogic::staff_beed(), JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('category_lists', json_encode(StaffLogic::getAllTree(), JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('group_id',json_encode(StaffLogic::staff_beed(),JSON_UNESCAPED_UNICODE)); //获取员工的部门
|
||||
$this->assign('goods_id',json_encode(StaffLogic::goods_type(),JSON_UNESCAPED_UNICODE)); //获取员工的技能
|
||||
|
||||
$this->assign('grouping_id',json_encode(StaffLogic::grouping(),JSON_UNESCAPED_UNICODE)); //获取员工的分组
|
||||
|
||||
$this->assign('infos',$infos);
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除员工的数据
|
||||
* @param 杨左
|
||||
* @param 哆啦猫家政
|
||||
*/
|
||||
public function del($id){
|
||||
$list=Db::name('staff')->where('id',$id)->delete();
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
/**
|
||||
* 员工数据统计
|
||||
* @param 杨左
|
||||
* @param 哆啦猫家政
|
||||
*/
|
||||
public function info($id){
|
||||
$detail=Db::name('staff')->where('id',$id)->find(); //获取员工的基本信息
|
||||
$detail['image']=UrlServer::getFileUrl($detail['image']);
|
||||
if($detail['sex']==1){
|
||||
$detail['sex']='男';
|
||||
}elseif($detail['sex']==2){
|
||||
$detail['sex']='女';
|
||||
}
|
||||
|
||||
|
||||
$this->assign('detail',$detail);
|
||||
return $this->fetch('',$detail);
|
||||
}
|
||||
|
||||
|
||||
//增加权限列表
|
||||
public function add_staffauth(){
|
||||
if ($this->request->isAjax()) {
|
||||
$sn = $this->request->post('sn');
|
||||
$remarks=$this->request->post('remarks');
|
||||
$time=time();
|
||||
$insert=Db::name('staff_auth')->data(['name'=>$sn,'remarks'=>$remarks,'time'=>$time])->insert();
|
||||
$this->_success('增加成功');
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
//编辑员工权限名称
|
||||
public function updata_staffauth(){
|
||||
$id = $this->request->get('id');
|
||||
if ($this->request->isAjax()) {
|
||||
$sn = $this->request->post('sn');
|
||||
$remarks=$this->request->post('remarks');
|
||||
$aupdate=Db::name('staff_auth')->where('id',$id)->data(['name'=>$sn,'remarks'=>$remarks])->update();
|
||||
$this->_success('更新成功');
|
||||
}
|
||||
|
||||
$name=Db::name('staff_auth')->where('id',$id)->find();
|
||||
$this->assign('name',$name);
|
||||
return $this->fetch();
|
||||
}
|
||||
//员工排班情况
|
||||
public function stafflist(){
|
||||
$txt = trim(input('txt'));
|
||||
$where = [];
|
||||
|
||||
if($txt && !is_numeric($txt)){
|
||||
$where = [
|
||||
['name','like','%'.$txt.'%'],
|
||||
// ['mobile','like','%'.$txt.'%']
|
||||
];
|
||||
}
|
||||
if($txt && is_numeric($txt)){
|
||||
$where = [
|
||||
['mobile','=',$txt],
|
||||
// ['mobile','like','%'.$txt.'%']
|
||||
];
|
||||
}
|
||||
// var_dump($where);
|
||||
$list=Db::name('staff')->where('onwork',1)->where($where)->select();
|
||||
foreach($list as $item=>$k){
|
||||
$list[$item]['marry']=Db::name('order_exe')->where('staff_id', $list[$item]['id'])->count();
|
||||
}
|
||||
$this->_success('获取成功',$list);
|
||||
}
|
||||
|
||||
//服务人员排期
|
||||
public function Scheduling(){
|
||||
$id = $this->request->get('uid'); //获取到用户的ID
|
||||
$staff=Db::name('order_exe')->where('staff_id',$id)->select();
|
||||
$lendt=Db::name('leave')->where('user_id',$id)->select();
|
||||
if($staff){
|
||||
foreach($staff as $k=> $v){
|
||||
$staff[$k]['date'] = date('Y-m-d',strtotime($v['date']));
|
||||
$custom=Db::name('order')->where('order_sn', $staff[$k]['order_sn'])->find();
|
||||
if( $custom){
|
||||
$staff[$k]['custom']= $custom['consignee'];
|
||||
$staff[$k]['mobile']= $custom['mobile'];
|
||||
$staff[$k]['address']= $custom['address'];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if($lendt){
|
||||
foreach($lendt as$k=> $v){
|
||||
$lendt[$k]['time'] = date('Y-m-d',$v['time']);
|
||||
}
|
||||
}
|
||||
|
||||
$qj2 = Db::name('leavesd')->where('staff_id',$id)->where('status',1)->select();
|
||||
|
||||
if(!empty($qj2)){
|
||||
foreach($qj2 as$k=> $v){
|
||||
$qj2[$k]['time'] = date('Y-m-d',$v['time']);
|
||||
}
|
||||
}
|
||||
// var_dump($lendt);die;
|
||||
$list['pb'] = $staff;
|
||||
$list['qj'] = $lendt;
|
||||
$list['qj2'] = $qj2;
|
||||
// $list= array_merge($staff, $lendt);
|
||||
$list['now'] = date('Y-m',time());
|
||||
$this->_success('获取成功',$list);
|
||||
}
|
||||
|
||||
//是否再范围内
|
||||
public function is_ptin_poly($aLon, $aLat, $pointList = array())
|
||||
{
|
||||
$iSum = 0;
|
||||
$iCount = count($pointList);
|
||||
if ($iCount < 3) {
|
||||
return false;
|
||||
}
|
||||
foreach ($pointList as $key => $row) {
|
||||
$pLon1 = $row[0];
|
||||
$pLat1 = $row[1];
|
||||
if ($key === $iCount - 1) {
|
||||
$pLon2 = $pointList[0][0];
|
||||
$pLat2 = $pointList[0][1];
|
||||
} else {
|
||||
$pLon2 = $pointList[$key + 1][0];
|
||||
$pLat2 = $pointList[$key + 1][1];
|
||||
}
|
||||
if ((($aLat >= $pLat1) && ($aLat < $pLat2)) || (($aLat >= $pLat2) && ($aLat < $pLat1))) {
|
||||
if (abs($pLat1 - $pLat2) > 0) {
|
||||
$pLon = $pLon1 - (($pLon1 - $pLon2) * ($pLat1 - $aLat)) / ($pLat1 - $pLat2);
|
||||
if ($pLon < $aLon) {
|
||||
$iSum += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($iSum % 2 != 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 根据时间查询等待派单的人工
|
||||
* @param 传递时间
|
||||
* @param 查询请假和派单
|
||||
*/
|
||||
|
||||
//判断用户接单
|
||||
public function havestaff(){
|
||||
$postadd = $this->request->post(); //获取到用户的ID
|
||||
$addtime=$postadd['data']['addtime'];
|
||||
$time=strtotime($postadd['data']['end_time']);
|
||||
$timestamp=$time+(24*3600);
|
||||
$order=Db::name('order')->where('order_sn',$postadd['data']['order'])->find();
|
||||
$goods=Db::name('goods')->where('id',$order['goods_id'])->find();
|
||||
$order=Db::name('order_exe')->where('addtime',$addtime)
|
||||
->where('autotime','>=',$time)
|
||||
->where('autotime','<',$timestamp)
|
||||
->whereNotNull('staff_id','>',0)
|
||||
->whereNotNull('staff_id')
|
||||
->field('staff_id')
|
||||
->group('staff_id')
|
||||
->select(); //查询有订单的保洁师傅
|
||||
$oneDimensionalArray = array_column($order, 'staff_id'); // 根据自己的表格字段名修改'字段名'部分
|
||||
|
||||
$lent=Db::name('leave')
|
||||
->where('addtime',$addtime)
|
||||
->where('time','>=',$time)
|
||||
->where('time','<',$timestamp)
|
||||
->whereNotNull('user_id')
|
||||
->field('user_id')->group('user_id')->select();
|
||||
|
||||
$lentuser = array_column($lent, 'user_id');
|
||||
|
||||
$ads=$postadd['data']['addtime']-1;
|
||||
|
||||
$lent2 = Db::name('leavesd')
|
||||
->where('status','=',1)
|
||||
->where('time','>=',$time)
|
||||
->where('time','<',$timestamp)
|
||||
->whereNotNull('staff_id')
|
||||
->where('addtime','=',$postadd['data']['addtime']-1)
|
||||
//->having('addtime',$postadd['data']['addtime']-1)
|
||||
->field('staff_id,addtime')->group('staff_id')->select();
|
||||
|
||||
|
||||
$lentuser2 = array_column($lent2, 'staff_id');
|
||||
|
||||
$lent3=Db::name('leavesd')
|
||||
->where('status','=',1)
|
||||
->where('time','>=',$time)
|
||||
->where('time','<',$timestamp)
|
||||
->where('addtime','=',2)
|
||||
->whereNotNull('staff_id')
|
||||
->field('staff_id,addtime')->group('staff_id')->select();
|
||||
|
||||
|
||||
$lentuser3 = array_column($lent3, 'staff_id');
|
||||
|
||||
$list=Db::name('staff')
|
||||
->where('goods_id',$goods['brand_id'])
|
||||
->whereNotIn('id',$oneDimensionalArray) // $array为要比较的数组
|
||||
->whereNotIn('id',$lentuser) // $array为要比较的数组
|
||||
->whereNotIn('id',$lentuser2) // $array为要比较的数组
|
||||
->whereNotIn('id',$lentuser3) // $array为要比较的数组
|
||||
->where('onwork',1)
|
||||
->where('state', '=', 0) // 也可以这样写
|
||||
->select();
|
||||
|
||||
|
||||
// 函数:将数组转换为 LatLng 对象数组
|
||||
function convertToLatLngArray($coordArray) {
|
||||
$latLngArray = [];
|
||||
for ($i = 0; $i < count($coordArray); $i += 2) {
|
||||
$lat = floatval($coordArray[$i]);
|
||||
$lng = floatval($coordArray[$i + 1]);
|
||||
$latLngArray[] = [$lng,$lat];
|
||||
}
|
||||
return $latLngArray;
|
||||
}
|
||||
|
||||
|
||||
foreach($list as $item=>$k){
|
||||
|
||||
//获取用户的范围
|
||||
if( !$list[$item]['lnglat']){
|
||||
unset($list[$item]);
|
||||
continue;
|
||||
}
|
||||
$points = convertToLatLngArray(explode(',',$list[$item]['lnglat']));
|
||||
if(!$this->is_ptin_poly($postadd['data']['lat'],$postadd['data']['lng'],$points)){
|
||||
unset($list[$item]);
|
||||
continue;
|
||||
}
|
||||
$june = number_format(UserLogic::haversine_distance($postadd['data']['lng'],$postadd['data']['lat'], $list[$item]['lng'],$list[$item]['lat'])/1000,1);
|
||||
if($k['distance'] < $june){
|
||||
unset($list[$item]);
|
||||
}else{
|
||||
$list[$item]['june']=number_format(UserLogic::haversine_distance($postadd['data']['lat'],$postadd['data']['lng'], $list[$item]['lng'],$list[$item]['lat'])/1000,1);
|
||||
$order_exe=Db::name('order_exe')
|
||||
->where('staff_id',$list[$item]['id'])
|
||||
->where('autotime','>=',$time)
|
||||
->where('autotime','<',$timestamp)
|
||||
->find();
|
||||
if($order_exe){
|
||||
$order=Db::name('order')->where('order_sn',$order_exe['order_sn'])->find();
|
||||
$list[$item]['order_adder']= $order['address'] ;
|
||||
}else{
|
||||
$list[$item]['order_adder']='无';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//根据员工iD查询地址
|
||||
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
//员工分组
|
||||
public function group_list(){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->get(); //获取到传递过来的参数
|
||||
|
||||
$lists =StaffLogic::group_list($post);
|
||||
$this->_success('获取数据成功',$lists);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//增加员工的分组
|
||||
|
||||
public function group_add(){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post(); //获取到传递过来的参数
|
||||
$staff=Db::name('staff')->where('id',$post['admin_id'])->find();
|
||||
$group=Db::name('staff')->where('id',$post['group_id'])->find();
|
||||
$data=[
|
||||
'name'=>$post['name'],
|
||||
'admin_id'=>$post['admin_id'],
|
||||
'staff_name'=>$staff['name'],
|
||||
'staff_phone'=>$staff['mobile'],
|
||||
'group_id'=>$post['group_id'],
|
||||
'group_name'=>$group['name'],
|
||||
'group_phone'=>$group['mobile'],
|
||||
'create_time'=>time(),
|
||||
];
|
||||
$insert=Db::name('staff_grouping')->data($data)->insert();
|
||||
if($insert){
|
||||
$this->_success('增加数据成功');
|
||||
}
|
||||
}
|
||||
|
||||
$staff=Db::name('staff')->where('onwork',1)->select();
|
||||
$this->assign('staff',$staff);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//编辑员工分组
|
||||
|
||||
public function group_edit(){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$staff=Db::name('staff')->where('id',$post['admin_id'])->find();
|
||||
$group=Db::name('staff')->where('id',$post['group_id'])->find();
|
||||
$data=[
|
||||
'name'=>$post['name'],
|
||||
'admin_id'=>$post['admin_id'],
|
||||
'staff_name'=>$staff['name'],
|
||||
'staff_phone'=>$staff['mobile'],
|
||||
'group_id'=>$post['group_id'],
|
||||
'group_name'=>$group['name'],
|
||||
'group_phone'=>$group['mobile'],
|
||||
'create_time'=>time(),
|
||||
];
|
||||
$insert=Db::name('staff_grouping')->where('id',$post['id'])->data($data)->update();
|
||||
$this->_success('增加数据成功');
|
||||
}
|
||||
$get = $this->request->get();
|
||||
$info=DB::name('staff_grouping')->where('id',$get['id'])->find();
|
||||
$this->assign('info',$info);
|
||||
$group=Db::name('staff')->where('onwork',1)->select();
|
||||
$this->assign('group',$group);
|
||||
$staff=Db::name('staff')->where('onwork',1)->select();
|
||||
$this->assign('staff',$staff);
|
||||
return $this->fetch();
|
||||
|
||||
}
|
||||
//获取员工分组下面的员工
|
||||
public function group_info(){
|
||||
$id = $this->request->get('id');
|
||||
$this->assign('id',$id);
|
||||
return $this->fetch();
|
||||
}
|
||||
public function infolist(){
|
||||
$get= $this->request->get();
|
||||
$infolist =StaffLogic::infolist($get);
|
||||
|
||||
|
||||
$this->_success('获取数据成功',$infolist);
|
||||
}
|
||||
|
||||
//删除员工的分组
|
||||
public function group_del(){
|
||||
$post = $this->request->post();
|
||||
$del=Db::name('staff_grouping')->where('id',$post['id'])->delete();
|
||||
$this->_success('删除数据成功');
|
||||
}
|
||||
|
||||
//员工端口公告
|
||||
public function staff_notice(){
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get(); //获取到传递过来的参数
|
||||
$lists =StaffLogic::staff_notice($get);
|
||||
$this->_success('获取数据成功',$lists);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//增加员端口公告
|
||||
public function staff_noticeadd(){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post(); //获取到传递过来的参数
|
||||
$noticeadd =StaffLogic::staff_noticeadd($post);
|
||||
$this->_success('增加公告成功');
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//修改员工端口的公告
|
||||
public function staff_noticedit(){
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->post(); //获取到传递过来的参数
|
||||
$lists =StaffLogic::staff_noticedit($get);
|
||||
$this->_success('修改数据成功');
|
||||
}
|
||||
$get = $this->request->get();
|
||||
$noticeinfo=DB::name('staff_notice')->where('id',$get['id'])->find();
|
||||
$this->assign('noticeinfo',$noticeinfo);
|
||||
return $this->fetch();
|
||||
}
|
||||
//删除员工端口公告
|
||||
public function staff_noticedel(){
|
||||
$post = $this->request->post();
|
||||
$del=Db::name('staff_notice')->where('id',$post['id'])->delete();
|
||||
$this->_success('删除数据成功');
|
||||
}
|
||||
|
||||
//员工的工资
|
||||
public function wages(){
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get(); //获取到传递过来的参数
|
||||
$lists=StaffLogic::wages($get);
|
||||
$this->_success('获取数据成功',$lists);
|
||||
}
|
||||
$this->assign('staff',StaffLogic::serverstaff());
|
||||
$this->assign('goods_brand',StaffLogic::goods_brand());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//删除员工的工资
|
||||
public function wagesdel(){
|
||||
$post = $this->request->post('id'); //获取到传递过来的参数
|
||||
$this->_success('删除工资成功',StaffLogic::wagesdel($post));
|
||||
|
||||
}
|
||||
//修改定位功能
|
||||
public function adder(){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post(); //获取到传递过来的参数
|
||||
$list=StaffLogic::adder($post);
|
||||
$this->_success('修改定位成功');
|
||||
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
//员工积分记录
|
||||
public function points(){
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get(); //获取到传递过来的参数
|
||||
$list=StaffLogic::points($get);
|
||||
$this->_success('获取数据成功',$list);
|
||||
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user