diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 diff --git a/.travis.yml b/.travis.yml old mode 100755 new mode 100644 diff --git a/CHANGELOG.md b/CHANGELOG.md old mode 100755 new mode 100644 diff --git a/LICENSE.txt b/LICENSE.txt old mode 100755 new mode 100644 diff --git a/README.md b/README.md old mode 100755 new mode 100644 diff --git a/application/.htaccess b/application/.htaccess old mode 100755 new mode 100644 diff --git a/application/command.php b/application/command.php old mode 100755 new mode 100644 diff --git a/application/common.php b/application/common.php old mode 100755 new mode 100644 diff --git a/application/config.php b/application/config.php old mode 100755 new mode 100644 diff --git a/application/database.php b/application/database.php old mode 100755 new mode 100644 index 78785ee..c3dda8c --- a/application/database.php +++ b/application/database.php @@ -13,13 +13,13 @@ return [ // 数据库类型 'type' => 'mysql', // 服务器地址 - 'hostname' => '127.0.0.1', + 'hostname' => 'mysql', // 数据库名 - 'database' => 'greenschool', + 'database' => 'h5pay_green_akuh', // 用户名 - 'username' => 'root', + 'username' => 'h5pay_green_akuh', // 密码 - 'password' => 'root', + 'password' => 'rHC3EaxEHte4wiAM', // 端口 'hostport' => '', // 连接dsn diff --git a/application/extra/queue.php b/application/extra/queue.php old mode 100755 new mode 100644 diff --git a/application/index/controller/Index.php b/application/index/controller/Index.php old mode 100755 new mode 100644 index 0d482f6..d615b35 --- a/application/index/controller/Index.php +++ b/application/index/controller/Index.php @@ -25,6 +25,34 @@ class Index extends Controller $this->assign('data',$data); return $this->fetch(); } + // 红色 + public function red(){ + $data=db('activity')->where('id',117)->find(); + $data['son']=db('activity')->where('parentid',$data['id'])->order('sonid asc')->select(); + $this->assign('data',$data); + return $this->fetch(); + } + // 获取年数据 + public function redYear(){ + $year = input('year',date('Y'),'intval'); + $data=db('activity')->where('parentid',117)->whereBetween('start_time',[$year.'-01-01',$year.'-12-31'])->order('start_time desc,sonid asc')->select(); + //这边要改成按照付款人数来显示 + foreach ($data as $k=>$v){ + $data[$k]['buy_num']=db('order')->where(['aid'=>$v['id'],'status'=>2])->count(); + } + $this->result($data,0,'','json'); + } + + // 获取年数据 + public function trainingYear(){ + $year = input('year',date('Y'),'intval'); + $data=db('activity')->where('parentid',19)->whereBetween('start_time',[$year.'-01-01',$year.'-12-31'])->order('start_time desc,sonid asc')->select(); + //这边要改成按照付款人数来显示 + foreach ($data as $k=>$v){ + $data[$k]['buy_num']=db('order')->where(['aid'=>$v['id'],'status'=>2])->count(); + } + $this->result($data,0,'','json'); + } //社会实践教育 public function practice(){ $data=db('activity')->where('id',28)->find(); @@ -36,7 +64,29 @@ class Index extends Controller $this->assign('data',$data); return $this->fetch(); } - + //社会实践教育 + public function practices(){ + $data=db('activity')->where('id',28)->find(); + $data['son']=db('activity')->where('parentid',$data['id'])->order('sonid asc')->select(); + //这边要改成按照付款人数来显示 + foreach ($data['son'] as $k=>$v){ + $data['son'][$k]['buy_num']=db('order')->where(['aid'=>$v['id'],'status'=>2])->count(); + } + $this->assign('data',$data); + return $this->fetch(); + } + + // 获取年数据 + public function practiceYear(){ + $year = input('year',date('Y'),'intval'); + $data=db('activity')->where('parentid',28)->whereBetween('start_time',[$year.'-01-01',$year.'-12-31'])->order('start_time desc,sonid asc')->select(); + //这边要改成按照付款人数来显示 + foreach ($data as $k=>$v){ + $data[$k]['buy_num']=db('order')->where(['aid'=>$v['id'],'status'=>2])->count(); + } + $this->result($data,0,'','json'); + } + //获取班级页面 public function getClass(){ $aid=(int) input('aid'); @@ -54,6 +104,7 @@ class Index extends Controller $fu=db('activity')->where('id',$son['parentid'])->find(); $data['title']=$fu['title']; $data['start_time']=$son['start_time']; + $data['end_time']=$son['end_time']; $data['sex']=$data['sex']==1?'男':'女'; $this->assign('data',$data); return $this->fetch(); @@ -61,12 +112,13 @@ class Index extends Controller public function insertOrder(){ $data['aid']=(int)input('id'); - $data['grade']=input('grade'); + $data['grade']=input('grade',""); $data['name']=input('name'); - $data['school']=input('school'); + $data['school']=input('school',""); $data['sex']=(int)input('sex'); $data['phone']=(int)input('phone'); - $data['sfz']=input('sfz'); + $data['sfz']=input('sfz',""); + $type=input('type',0,'intval'); if(!$data['aid']){ $res['code']='FAIL'; @@ -83,18 +135,20 @@ class Index extends Controller $res['msg']='没有选择性别'; return json($res); } - if(!$data['school']){ - $res['code']='FAIL'; - $res['msg']='没有填写学校'; - return json($res); - } + if ($type != 2) { + if(!$data['school']){ + $res['code']='FAIL'; + $res['msg']='没有填写学校'; + return json($res); + } - if(!$data['grade']){ - $res['code']='FAIL'; - $res['msg']='没有填写年级'; - return json($res); - } + if(!$data['grade']){ + $res['code']='FAIL'; + $res['msg']='没有填写年级'; + return json($res); + } + } if(!$data['phone']){ $res['code']='FAIL'; $res['msg']='没有填写手机号'; @@ -124,16 +178,21 @@ class Index extends Controller $res['msg']='活动人数已满,请报名其它活动'; return json($res); } + if (time() > strtotime($activity_data['end_time'])) { + #$res['code']='FAIL'; + #$res['msg']='报名已截止'; + #return json($res); + } if($fuActivity_data['id']==19 or $fuActivity_data['id']==28){ }else{ //如果不是军训的话 就要身份证 - if(!$data['sfz']){ - $res['code']='FAIL'; - $res['msg']='没有填写身份证'; - return json($res); - } +// if(!$data['sfz']){ +// $res['code']='FAIL'; +// $res['msg']='没有填写身份证'; +// return json($res); +// } } //插入未支付的订单 @@ -203,7 +262,7 @@ class Index extends Controller $this->assign('jsApiParameters',$jsApiParameters); $this->assign('oid',$id); return $this->fetch(); - + } @@ -236,9 +295,20 @@ class Index extends Controller } return $this->fetch(); } + + // 夏令营页面 + public function summerCamp(){ + return $this->fetch(); + } + + // 夏令营支付页面 + public function summerPay(){ + return $this->fetch(); + } public function orderList(){ + $type=input('type',0,'intval'); //获取活动数据 - $data=db('activity')->where('parentid',0)->order('id asc')->select(); + $data=db('activity')->where("type", $type)->where('parentid',0)->order('id asc')->select(); foreach ($data as $k=>$v){ $data[$k]['son']=db('activity')->where('parentid',$v['id'])->order('id asc')->select(); //获取每一期的数据 @@ -249,7 +319,7 @@ class Index extends Controller return json($data); } - + public function meorder(){ define('SYSAPPID','wx1364ecc533a2e290'); define('SYSMCHID','1529570041'); @@ -286,7 +356,7 @@ class Index extends Controller } //下面的导出暂时先不用 - + //导出表格 public function exportExcel(){ //处理数据 @@ -305,7 +375,7 @@ class Index extends Controller $v['day']='0'.$v['day']; } $tableheader[]=$v['month'].'-'.$v['day']; - + foreach ($manager_data as $k1=>$v1){ $mapson['manager_id']=$v1['id']; $mapson['time']=['like',$map['year'].'-'.$v['month'].'-'.$v['day'].'%']; @@ -330,7 +400,7 @@ class Index extends Controller } } - + //dump($tableheader); diff --git a/application/index/view/index/feiqi.html b/application/index/view/index/feiqi.html index 3b1236b..a63cc15 100644 --- a/application/index/view/index/feiqi.html +++ b/application/index/view/index/feiqi.html @@ -37,7 +37,7 @@