12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
- namespace app\api\controller\v1;
- use app\api\controller\Base;
- use app\hander\HelpHander;
- use think\Db;
- class UserLabor extends Base
- {
- // 新增
- public function save(){
- model('UserLabor')->add();
- HelpHander::success([],'操作成功');
- }
- // 编辑
- public function update(){
- model('UserLabor')->add();
- HelpHander::success([],'操作成功');
- }
- // 详情
- public function detail(){
- $id = input('id/d',0);
- $ret = model('UserLabor')->info($id);
- HelpHander::success($ret);
- }
- // 列表
- public function list(){
- $page = input('page/d',1);
- $size = input('size/d',10);
- $name = input('name','','trim');
- $phone = input('phone','','trim');
- $status = input('status/d',-1);
- $ret = model('UserLabor')->lists($page,$size,$this->orgId,$name,$phone,$status);
- HelpHander::success($ret);
- }
- // 修改状态
- public function updateStatus(){
- $id = input('id/d',0);
- $enable = input('status/d',0);
- model('UserLabor')->changeStatus($id,$enable);
- HelpHander::success([],'操作成功');
- }
- // 获取正式/试用
- public function laborUser(){
- $page = input('page/d',1);
- $size = input('size/d',10);
- $name = input('name','','trim');
- $phone = input('phone','','trim');
- $ret = model('UserLabor')->laborUser($page,$size,$name,$phone,$this->orgId);
- HelpHander::success($ret);
- }
- // 删除
- public function del(){
- $id = input('id/d',0);
- model('UserLabor')->del($id);
- HelpHander::success([],'操作成功');
- }
- }
|