123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <?php
- namespace app\api\controller\v1;
- use app\api\controller\Base;
- use app\hander\HelpHander;
- class Approval extends Base
- {
- // 新增
- public function save(){
- model('Approval')->add();
- HelpHander::success([],'操作成功');
- }
- // 编辑
- public function update(){
- model('Approval')->add();
- HelpHander::success([],'操作成功');
- }
- // 列表
- public function list(){
- $ret = model('Approval')->lists($this->orgId);
- HelpHander::success($ret);
- }
- // 详情
- public function detail(){
- $id = input('id/d',0);
- $ret = model('Approval')->info($id,$this->userId,$this->orgId);
- HelpHander::success($ret);
- }
- // 删除
- public function del(){
- $id = input('id/d',0);
- model('Approval')->del($id);
- HelpHander::success([],'操作成功');
- }
- // 修改状态
- public function changeStatus(){
- $id = input('id/d',0);
- $enable = input('enable/d',0);
- model('Approval')->changeStatus($id,$enable);
- HelpHander::success([],'操作成功');
- }
- // 获取用户
- public function queryApprovalCateList(){
- $ret = model('Approval')->queryApprovalCateList($this->userId,$this->orgId);
- HelpHander::success($ret);
- }
- // 自定义选择聚合接口
- public function customSelect(){
- $defaultApi = input('defaultApi/d',0);
- $lists = [];
- switch ($defaultApi){
- case 1: // 会议室
- $lists = model('MeetingRoom')->all($this->orgId);
- break;
- case 2: // 公司
- $lists = model('Company')->lists($this->orgId);
- break;
- case 3: // 项目
- $lists = model('Program')->allLists($this->orgId);
- break;
- case 4: // 印花税
- $lists = model('StampDuty')->allLists($this->orgId);
- break;
- case 5: // 车辆
- $lists = model('Car')->all($this->orgId);
- break;
- case 6: // 预算项目
- $list = model('Budget')->alllist($this->userId,$this->orgId);
- $lists = [];
- foreach ($list as $k=>$v){
- foreach ($v['items'] as $kk=>$vv){
- $lists[] = $vv;
- }
- }
- break;
- }
- HelpHander::success($lists);
- }
- }
|