122 lines
4.9 KiB
PHP
122 lines
4.9 KiB
PHP
<?php
|
||
// +----------------------------------------------------------------------
|
||
// | likeshop100%开源免费商用商城系统
|
||
// +----------------------------------------------------------------------
|
||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||
// | 开源版本可自由商用,可去除界面版权logo
|
||
// | 商业版本务必购买商业授权,以免引起法律纠纷
|
||
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||
// | gitee下载:https://gitee.com/likeshop_gitee
|
||
// | github下载:https://github.com/likeshop-github
|
||
// | 访问官网:https://www.likeshop.cn
|
||
// | 访问社区:https://home.likeshop.cn
|
||
// | 访问手册:http://doc.likeshop.cn
|
||
// | 微信公众号:likeshop技术社区
|
||
// | likeshop团队 版权所有 拥有最终解释权
|
||
// +----------------------------------------------------------------------
|
||
// | author: likeshopTeam
|
||
// +----------------------------------------------------------------------
|
||
namespace app\api\controller;
|
||
use app\api\logic\LeadershipLogic;
|
||
use think\Db;
|
||
|
||
class Leadership extends ApiBase{
|
||
public $like_not_need_login = ['index','material_list','material_examine','material_notpass','finance_list','finance_examine','finance_notpass','addorder_list','addorder_examine','addorder_notpass','staff_list'];
|
||
/**
|
||
* Notes: pc端首页接口
|
||
* @author: 2021/3/5 12:00
|
||
*/
|
||
public function index(){
|
||
$lists = PcLogic::pcLists();
|
||
return $this->_success('',$lists);
|
||
}
|
||
|
||
//获取等待审核物料的数据列表
|
||
public function material_list(){
|
||
$get = $this->request->get(); //获取前端传递过来的数据
|
||
$list = LeadershipLogic::material_list($get);
|
||
$this->_success('获取成功',$list);
|
||
|
||
}
|
||
|
||
|
||
//点击审核通过
|
||
public function material_examine(){
|
||
$get = $this->request->get(); //获取前端传递过来的数据
|
||
$update=Db::name('erp_staff')->where('id',$get['id'])->update(['status'=>2]);
|
||
$this->_success('审核通过');
|
||
|
||
}
|
||
|
||
//点击审核不通过
|
||
public function material_notpass(){
|
||
$get = $this->request->get(); //获取前端传递过来的数据
|
||
$update=Db::name('erp_staff')->where('id',$get['id'])->update(['status'=>3,'reason'=>$get['data']]);
|
||
$this->_success('审核通过');
|
||
|
||
}
|
||
|
||
|
||
//获取报销的列表
|
||
public function finance_list(){
|
||
$get = $this->request->get(); //获取前端传递过来的数据
|
||
$list = LeadershipLogic::finance_list($get);
|
||
$this->_success('获取成功',$list);
|
||
}
|
||
|
||
//报销审核通过
|
||
public function finance_examine(){
|
||
$get= $this->request->get(); //获取前端传递过来的数据
|
||
$info=Db::name('finance')->where('id',$get['id'])->find();
|
||
$update=Db::name('finance')->where('id',$get['id'])->update(['status'=>2,'staff_id'=>$get['staff_id']]);
|
||
$order=Db::name('order_exe')->where('id',$info['order_id'])->update(['account'=>$info['pay']]);
|
||
$this->_success('审核通过');
|
||
}
|
||
//报销审核不通过的理由
|
||
public function finance_notpass(){
|
||
$get= $this->request->get(); //获取前端传递过来的数据
|
||
$update=Db::name('finance')->where('id',$get['id'])->update(['status'=>3,'reason'=>$get['data']]);
|
||
$this->_success('修改状态成功');
|
||
}
|
||
|
||
//获取报销的列表
|
||
public function addorder_list(){
|
||
$get = $this->request->get(); //获取前端传递过来的数据
|
||
$list = LeadershipLogic::addorder_list($get);
|
||
$this->_success('获取成功',$list);
|
||
}
|
||
|
||
//加时间通过代码
|
||
public function addorder_examine(){
|
||
$get= $this->request->get(); //获取前端传递过来的数据
|
||
$info=Db::name('order_timeadd')->where('id',$get['id'])->find();
|
||
$update=Db::name('order_timeadd')->where('id',$get['id'])->update(['status'=>2,'staff_id'=>$get['staff_id']]);
|
||
$order=Db::name('order_exe')->where('id',$info['orderid'])->update(['add'=>$info['minute']]);
|
||
$this->_success('审核通过');
|
||
}
|
||
//加时间审核不通过代码
|
||
public function addorder_notpass(){
|
||
$get= $this->request->get(); //获取前端传递过来的数据
|
||
$update=Db::name('order_timeadd')->where('id',$get['id'])->update(['status'=>3,'reason'=>$get['data']]);
|
||
$this->_success('修改状态成功');
|
||
}
|
||
|
||
//获取站长员工下面的信息
|
||
public function staff_list(){
|
||
$get= $this->request->get(); //获取前端传递过来的数据
|
||
$data=Db::name('leavesd')
|
||
->where('staff_id',$get['staff_id'])
|
||
->find();
|
||
if($data){
|
||
|
||
}
|
||
|
||
$list = LeadershipLogic::staff_list($get);
|
||
$this->_success('获取成功',$list);
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
} |