1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- namespace app\api\controller\v1;
- use app\api\controller\Base;
- use app\hander\HelpHander;
- class Car extends Base
- {
- // 新增
- public function save(){
- model('Car')->add();
- HelpHander::success([],'操作成功');
- }
- // 编辑
- public function update(){
- model('Car')->add();
- HelpHander::success([],'操作成功');
- }
- // 编辑里程
- public function recordUpdate(){
- model('CarRecord')->add();
- HelpHander::success([],'操作成功');
- }
- // 详情
- public function detail(){
- $id = input('id/d',0);
- $ret = model('Car')->info($id);
- HelpHander::success($ret);
- }
- // 列表
- public function list(){
- $page = input('page/d',1);
- $size = input('size/d',10);
- $title = input('title','','trim');
- $enable = input('enable/d',-1);
- $ret = model('Car')->lists($page,$size,$title,$enable,$this->orgId);
- HelpHander::success($ret);
- }
- public function all(){
- $ret = model('Car')->all($this->orgId);
- HelpHander::success($ret);
- }
- // 删除
- public function del(){
- $id = input('id/d',0);
- model('Car')->del($id);
- HelpHander::success([],'操作成功');
- }
- public function record(){
- $page = input('page/d',1);
- $size = input('size/d',10);
- $carId = input('carId/d',0);
- $ret = model('Car')->record($page,$size,$carId,$this->orgId);
- HelpHander::success($ret);
- }
- public function export(){
- $carId = input('carId/d',0);
- $ret = model('Car')->export($carId,$this->orgId);
- HelpHander::success($ret);
- }
- }
|