12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
- namespace app\api\controller\v1;
- use app\api\controller\Base;
- use app\hander\HelpHander;
- class BudgetItems extends Base
- {
- // 新增
- public function save(){
- model('BudgetItems')->add();
- HelpHander::success([],'操作成功');
- }
- // 编辑
- public function update(){
- model('BudgetItems')->add();
- HelpHander::success([],'操作成功');
- }
- // 详情
- public function detail(){
- $id = input('id/d',0);
- $ret = model('BudgetItems')->info($id);
- HelpHander::success($ret);
- }
- // 列表
- public function list(){
- $page = input('page/d',1);
- $size = input('size/d',10);
- $companyId = input('companyId/d',0);
- $title = input('title','','trim');
- $ret = model('BudgetItems')->lists($page,$size,$companyId,$title,$this->orgId);
- HelpHander::success($ret);
- }
- // 获取最近活动的预算项目
- public function newlist(){
- $companyId = input('companyId/d',0);
- $ret = model('BudgetItems')->newlists($companyId,$this->orgId);
- HelpHander::success($ret);
- }
- public function newBudget(){
- $ret = model('BudgetItems')->newbudget($this->orgId,$this->userId);
- HelpHander::success($ret);
- }
- // 删除
- public function del(){
- $id = input('id/d',0);
- model('BudgetItems')->del($id);
- HelpHander::success([],'操作成功');
- }
- // 当前可用列表
- public function curList(){
- $ret = model('BudgetItems')->curLists($this->orgId);
- HelpHander::success($ret);
- }
- // 获取所有预算项目
- public function all(){
- $ret = model('BudgetItems')->all($this->orgId);
- HelpHander::success($ret);
- }
- }
|