| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 | <?phpnamespace app\api\controller\h5;use app\hander\HelpHander;use think\Controller;use think\Db;use think\Exception;class Worker extends Base{      //推荐护工    public function hot(){        $model = new \app\common\model\Worker();        $data = $model->hotList($this->orgId);        HelpHander::success($data);    }    // 护工列表    public function lists(){        $page = input('page',1);        $size = input('size',10);        $model = new \app\common\model\Worker();        $res = $model->apiLists($this->orgId,[],$page,$size);        HelpHander::success($res['rows'],'操作成功');    }    // 用户下单    public function order(){        $model = new \app\common\model\PhOrders();        $res = $model->bookOrder();        if(!$res){            HelpHander::error($model->getError());        }        HelpHander::success(['payId'=>$res],'操作成功');    }    public function userInfo(){        $info  = Db::name('wxuser')            ->where('id',$this->userId)            ->find();        HelpHander::success($info);    }    // 护工列表    public function cates(){        $lists = Db::name('cate')->where('org_id',$this->orgId)->where('enable',1)->where('del',0)->select();        $lists = $lists?$lists:[];        foreach ($lists as $k=>$v){            $lists[$k]['title'] = $v['title']."[单价:".$v['price']."]";        }        HelpHander::success($lists,'操作成功');    }}
 |