123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace app\api\controller\h5;
- use app\hander\HelpHander;
- use think\Db;
- class Service extends Base
- {
- // 根据组织获取服务
- public function list(){
- $lists = Db::name('service')
- ->field('id,title')
- ->where('org_id',$this->orgId)
- ->where('del',0)
- ->where('enable',1)
- ->select();
- HelpHander::success($lists);
- }
- // 根据日期获取服务时间
- public function times(){
- $serviceId = input('serviceId/d');
- $day = input('day/s','','trim');
- $lists = Db::name('service_time')
- ->field('id,day,start,end,limit')
- ->where('org_id',$this->orgId)
- ->where('del',0)
- ->where('enable',1)
- ->where('service_id',$serviceId)
- ->where('day',$day)
- ->order('start asc')
- ->select();
- foreach ($lists as $k=>$v){
- $lists[$k]['start'] = date('H:i',strtotime($v['day'].' '.$v['start']));
- $lists[$k]['end'] = date('H:i',strtotime($v['day'].' '.$v['end']));
- }
- HelpHander::success($lists);
- }
- }
|