0
0

Worker.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace app\api\controller\h5;
  3. use app\hander\HelpHander;
  4. use think\Controller;
  5. use think\Db;
  6. use think\Exception;
  7. class Worker extends Base
  8. {
  9. //推荐护工
  10. public function hot(){
  11. $model = new \app\common\model\Worker();
  12. $data = $model->hotList($this->orgId);
  13. HelpHander::success($data);
  14. }
  15. // 护工列表
  16. public function lists(){
  17. $page = input('page',1);
  18. $size = input('size',10);
  19. $model = new \app\common\model\Worker();
  20. $res = $model->apiLists($this->orgId,[],$page,$size);
  21. HelpHander::success($res['rows'],'操作成功');
  22. }
  23. // 用户下单
  24. public function order(){
  25. $model = new \app\common\model\PhOrders();
  26. $res = $model->bookOrder();
  27. if(!$res){
  28. HelpHander::error($model->getError());
  29. }
  30. HelpHander::success($res,'操作成功');
  31. }
  32. public function userInfo(){
  33. $info = Db::name('wxuser')
  34. ->where('id',$this->userId)
  35. ->find();
  36. HelpHander::success($info);
  37. }
  38. }