1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058 |
- <?php
- /**
- * Created by PhpStorm.
- * User: chenye
- * Date: 2018/5/28
- * Time: 13:18
- * IMS销售类
- */
- class ImsSaleController extends Controller
- {
- public $layout = false;
- public function actionIndex()
- {
- //读取学校试用状态接口
- $http = http('order/coach/school/status', 'POST', $this->authUsername);
- $response = formatResponse($http);
- if ($response['status']) {
- $coachStatus = $response['data']['status'];
- }else{
- Yii::app()->jump->error($response['data']);
- }
- $this->render('index',array('coachStatus'=>$coachStatus));
- }
- /**
- * 产品试用规则
- */
- public function actionTrial()
- {
- $result = array();
- //当前赛季
- $http = http('sys/school/year/current', 'GET', $this->authUsername);
- $response = formatResponse($http);
- //debug($response);
- $data = $response['data'];
- if ($response['status']) {
- if ($data) {
- $result['seasonName'] = $data['periodName'].$data['semesterName'];
- $result['startDate'] = date('Y年m月d日', strtotime($data['semesterBeginTime']));
- $result['endDate'] = date('Y年m月d日', strtotime($data['semesterEndTime']));
- $result['examNum'] = $data['examNum'];
- $result['trialNum'] = $data['trialNum'];
- $result['seasonId'] = $data['seasonId'];
- }
- } else {
- Yii::app()->jump->error($data);
- }
- $this->render('trial', $result);
- }
- /**
- * @return array
- * 获取当前赛季信息
- */
- public function getCurrentSeason()
- {
- $result = array();
- $http = http('sys/school/year/current', 'GET', $this->authUsername);
- $response = formatResponse($http);
- $data = $response['data'];
- if ($response['status']) {
- if ($data) {
- // $result['seasonName'] = $data['seasonName'];
- // $result['startDate'] = date('Y年m月', strtotime($data['beginTime']));
- // $result['endDate'] = date('Y年m月', strtotime($data['endTime']));
- // $result['examNum'] = $data['examNum'];
- $result['schoolYearId'] = $data['schoolYearId'];
- $result['semesterId'] = $data['semesterId'];
- }
- }
- return $result;
- }
- /**
- * 产品试用列表
- */
- public function actionTrialTable()
- {
- $params = array();
- $result = array();
- $seasonId = Req::get('seasonId');
- $result['seasonName'] = Req::get('seasonName');
- $result['seasonId'] = $seasonId;
- $page = Req::get('page') ? Req::get('page') : 1;
- if(Req::get('seasonId')){
- $arr=explode('_',Req::get('seasonId'));
- $params['schoolYearId'] = $arr[0];
- $params['semesterId'] = $arr[1];
- }
- if (Req::get('goodsTypeId')) {
- $params['goodsTypeId'] = Req::get('goodsTypeId');
- }
- if (Req::get('grade')) {
- $params['grade'] = Req::get('grade');
- }
- if (Req::get('clazzId')) {
- $params['clazzId'] = Req::get('clazzId');
- }
- if (Req::get('subject')) {
- $params['subject'] = Req::get('subject');
- }
- //获取产品
- $goodArr = $this->getGoodType();
- $result['goodList'] = $goodArr;
- //获取赛季列表
- $seasonList = $this->getEnableImsSemester();
- $result['seasonList'] = $seasonList;
- $http = http('order/coach/trials/' . $page, 'POST', $this->authUsername, $params);
- $response = formatResponse($http);
- $data = $response['data'];
- if ($response['status']) {
- $result['page'] = $data;
- $result['list'] = isset($data['list'])?$data['list']:array();
- } else {
- $result['page'] = array();
- $result['list'] = array();
- }
- if(isset(Yii::app()->params['subjectId']) && Yii::app()->params['subjectId']){
- $result['subject']=Yii::app()->params['subjectId'];
- unset($result['subject'][6]);
- if(isset($result['subject'][20])) unset($result['subject'][20]);
- }
- // debug($result);
- return $this->render('trialTable', $result);
- }
- /*
- * 读取试用订单日志
- * */
- public function actionGetOrderLog(){
- $orderId = Req::post('orderId');
- $result['status']=0;
- if(!$orderId){
- exit(json_encode($result));
- }
- //请求日志
- $log = http('order/coach/trial/detail/'.$orderId, 'get', $this->authUsername, array());
- $logList=formatResponse($log);
- if(isset($logList['data']['orderLogs'])){
- $result['data']=$logList['data']['orderLogs'];
- }else{
- $result['data']=array();
- }
- $result['status']=1;
- exit(json_encode($result));
- }
- /**
- * 申请延长订单
- */
- public function actionRelayTrial()
- {
- $orderId = Req::post('orderId');
- $http = http('order/coach/trial/delay/'.$orderId,'put', $this->authUsername);
- $response = formatResponse($http);
- $this->imsLog("试用订单-申请延长",'order/coach/trial/delay/'.$orderId,array(),$response);
- if ($response['status']){
- $data = $response['data'];
- $needApply = isset($data['needApply'])?$data['needApply']:0;
- $delayDay = isset($data['delayDay'])?$data['delayDay']:0;
- if($needApply){
- $msg = "将延长试用".$delayDay."天,已通知后台审批";
- }else{
- $msg = "将延长试用".$delayDay."天,本次申请无需审批";
- }
- returnMsg(1,$msg);
- }else{
- returnMsg(0,$response['data']);
- }
- }
- /**
- * 开通产品试用列表
- */
- public function actionDoTrial()
- {
- //读取科目
- //$http = http('dictionary/coach/list/active-type/subject', 'get', $this->authUsername);
- $params=array();
- $params['onlyTrial']=1;
- $params['learningStage']=Yii::app()->params['section'];
- $http = http('goods-type/coach', 'get', $this->authUsername,$params);
- $response = formatResponse($http);
- $subjects=array();
- $goodArr=array();
- $schoolYear=0;
- if(isset($response['data']) && $response['status']==1){
- foreach ($response['data'] as $datum){
- $subjects[$datum['goodsTypeId']]=$datum['subjects'];
- $goodArr[]=array(
- 'goodsTypeId'=> $datum['goodsTypeId'],
- 'goodsTypeName'=> $datum['goodsTypeName'],
- );
- if(!$schoolYear){
- $schoolYear=$datum['schoolYear'];
- }
- }
- }
- if(!$schoolYear){
- Yii::app()->jump->error("获取学年异常");
- }
- //年级对应实际年级
- $semester=$this->schoolManager->getSemester($this->semesterId);
- $nowSemesterSchoolYear=$semester['school_year'];
- if(Yii::app()->params['section']!=0){
- if(strpos($semester['semester_name'],'上学期')!==false){
- $grade[1]=intval($schoolYear-($nowSemesterSchoolYear-1+1));
- $grade[2]=intval($schoolYear-($nowSemesterSchoolYear-2+1));
- $grade[3]=intval($schoolYear-($nowSemesterSchoolYear-3+1));
- }elseif(strpos($semester['semester_name'],'下学期')!==false || strpos($semester['semester_name'],'暑假')!==false || strpos($semester['semester_name'],'寒假')!==false){
- $grade[1]=intval($schoolYear-($nowSemesterSchoolYear-1));
- $grade[2]=intval($schoolYear-($nowSemesterSchoolYear-2));
- $grade[3]=intval($schoolYear-($nowSemesterSchoolYear-3));
- }
- }else{
- if(strpos($semester['semester_name'],'上学期')!==false){
- $grade[7]=intval($schoolYear-($nowSemesterSchoolYear-7+1));
- $grade[8]=intval($schoolYear-($nowSemesterSchoolYear-8+1));
- $grade[9]=intval($schoolYear-($nowSemesterSchoolYear-9+1));
- }elseif(strpos($semester['semester_name'],'下学期')!==false || strpos($semester['semester_name'],'暑假')!==false || strpos($semester['semester_name'],'寒假')!==false){
- $grade[7]=intval($schoolYear-($nowSemesterSchoolYear-7));
- $grade[8]=intval($schoolYear-($nowSemesterSchoolYear-8));
- $grade[9]=intval($schoolYear-($nowSemesterSchoolYear-9));
- }
- }
- if(Yii::app()->params['grade_list']){
- foreach (Yii::app()->params['grade_list'] as $id =>$param){
- $gradeName[$id]=$param['grade_name'];
- }
- }
- $result = array();
- //获取产品
- $result['goodList'] = $goodArr;
- $result['selectedStudent'] = array();
- $result['subjects']=$subjects;
- $result['grade']=$grade;
- $result['gradeName']=$gradeName;
- $this->render('doTrial', $result);
- }
- /**
- * 编辑产品试用列表
- */
- public function actionEditTrial()
- {
- $result = array();
- //获取产品
- $goodArr = $this->getGoodType();
- $result['goodList'] = $goodArr;
- //获取已经提交的数据
- $orderId = Req::get('orderId');
- $orderDetail = $this->getTrialOrderDetail($orderId);
- if(empty($orderDetail)){
- Yii::app()->jump->error("获取订单详情异常");
- }
- $result['grade'] = $orderDetail['grade'];
- $result['goodsTypeId'] = $orderDetail['goodsTypeId'];
- $result['startDate'] = $orderDetail['startDate'];
- //已经试用人数
- $http = http('order/coach/trial/students/'.$orderId, 'get', $this->authUsername);
- $response = formatResponse($http);
- $result['selectedStudent'] = $response['data'];
- $this->render('editTrial', $result);
- }
- /**
- * 提交试用订单(重新提交)
- */
- public function actionSaveTrial()
- {
- $studentIdArr = Req::post('studentList');
- $params['beginTime'] = Req::post('startTime');
- $params['grade'] = Req::post('grade');
- $params['goodsTypeId'] = Req::post('goodsTypeId');
- $params['subject'] = Req::post('subjectId');
- $params['trialType'] = Req::post('trialType');
- $params['yearSemester'] = Req::post('yearSemester');
- //$params['firstMarkTime'] = Req::post('endTime');
- $studentIdArr=str_replace('"','"',$studentIdArr);
- @$studentIdArr=json_decode($studentIdArr,true);
- $students = array();
- if(!$studentIdArr){
- returnMsg(0,'学生数据解析失败');
- }
- foreach ($studentIdArr as $k=>$v){
- if(!$v['class'] || !$v['classId'] || !$v['value'] || !$v['name']){
- continue;
- }
- $students[$k]['studentName'] = $v['name'];
- $students[$k]['studentId'] = $v['value'];
- $students[$k]['clazzName'] = $v['class'];
- $students[$k]['clazzId'] = $v['classId'];
- }
- $params['students'] = $students;
-
- if (Req::post('orderId')){
- $params['orderId'] = Req::post('orderId');
- $http = http('order/coach/trial','put', $this->authUsername, $params);
- }else{
- $http = http('order/coach/trial','post', $this->authUsername, $params);
- }
- $response = formatResponse($http);
- $this->imsLog("试用订单-提交",'order/coach/trial',$params,$response);
- if($response['status']){
- returnMsg(1,$response['data']);
- }else{
- if(Yii::app()->params['handle_log_on_off'])
- {
- writeFileLog(jsonEncode(array(
- "exam_group_id" => 0,
- "operate_project" => 'zsyas2',
- "school_id" => $this->schoolId,
- "title" => '创建试用订单失败',
- "operate_account" => Yii::app()->session['coachInfo']['coach_name'],
- "operate_method" => $this->action,
- "operate_url" => $this->getRoute(),
- "operate_sql" =>'',
- "operate_param" =>json_encode(array('post'=>$_POST,'get'=>$_GET,'param'=>$params)),
- "date"=>date('Y-m-d H:i:s')
- )));
- }
- returnMsg(0,$response['data']);
- }
- }
- /**
- * @return null|string|string[]
- * 试用人数列表
- */
- public function actionTrialStudent()
- {
- $result = array();
- if (Req::get('orderId')){
- $orderId = Req::get('orderId');
- $page = Req::get('page')?Req::get('page'):1;
- $http = http('order/coach/trial/students/'.$orderId.'/'.$page, 'get', $this->authUsername);
- $responseArr = formatResponse($http);
- if($responseArr['status']){
- $result['page'] = $responseArr['data'];
- $result['list'] = $responseArr['data']['list'];
- }
- //订单详情
- $goodsDetail = $this->getTrialOrderDetail($orderId);
- if(empty($goodsDetail)){
- Yii::app()->jump->error("获取订单详情异常");
- }
- //判断是否可以开启试用
- $http=http('order-trial-enable/coach/can-apply/'.$orderId, 'get', $this->authUsername);
- $responseArr = formatResponse($http);
- $result['canOpen']=0;
- $result['errMsg']='';
- if($responseArr['status']){
- $result['canOpen']=$responseArr['data'];
- }else{
- $result['errMsg']=$responseArr['data'];
- }
- $result['goodDetail'] = $goodsDetail;
- $result['orderId']=$orderId;
- }else{
- Yii::app()->jump->error("订单id必须;");
- }
- $this->render('trialStudent', $result);
- }
- //请求暂停、开启班级列表
- public function actionGetClassesByOrderId(){
- $orderId=Req::post('orderId');
- $type=Req::post('type');
- $result['status']=0;
- //读取班级列表
- $http = http('order/coach/all/clazz/by/'.$orderId.'/'.$type, 'get', $this->authUsername);
- $responseArr = formatResponse($http);
- if($responseArr['status']==1){
- $result=$responseArr;
- $result['students']=array();
- //读取学生列表
- if($result['data']){
- $classId=$result['data'][0]['clazzId'];
- $studentHttp= http('order/coach/all/student/by/'.$orderId.'/'.$classId.'/'.$type, 'get', $this->authUsername);
- $students=formatResponse($studentHttp);
- if($students['status']==1){
- $result['students']=$students['data'];
- }
- }
- }
- exit(json_encode($result));
- }
- //读取开启、暂停学生列表
- public function actionGetStudentByClassIdOrderId(){
- $orderId=Req::post('orderId');
- $type=Req::post('type');
- $classId=Req::post('classId');
- $result['status']=0;
- $studentHttp= http('order/coach/all/student/by/'.$orderId.'/'.$classId.'/'.$type, 'get', $this->authUsername);
- $students=formatResponse($studentHttp);
- if($students['status']==1){
- $result['status']=1;
- $result['data']=$students['data'];
- }
- exit(json_encode($result));
- }
- //开启、暂停学生订单
- public function actionDoStudentOrder(){
- $orderId=Req::post('orderId');
- $type=Req::post('type');
- $reason=Req::post('reason');
- $students=Req::post('selectedDataValue');
- $result['status']=0;
- $params=$students;
- if($type==0){
- $http= http('order/coach/suspend/'.$orderId, 'post', $this->authUsername,$params);
- }else{
- $params=array(
- 'otId'=>$orderId,
- 'osIds'=>$students,
- 'reason'=>$reason
- );
- $http= http('order-trial-enable/coach', 'post', $this->authUsername,$params);
- // $http= http('order/coach/enable/'.$orderId, 'post', $this->authUsername,$params);
- }
- $students=formatResponse($http);
- if($students['status']==1){
- $result['status']=1;
- }
- exit(json_encode($result));
- }
- public function getTrialOrderDetail($orderId)
- {
- $result = array();
- $http = http('order/coach/trial/detail/'.$orderId,'get', $this->authUsername);
- $response = formatResponse($http);
- if ($response['status']){
- $data = $response['data'];
- $result['goodsTypeName'] = $data['orderGoods']['goodsTypeName'];
- $result['gradeName'] = $data['gradeName'];
- $result['date'] = $data['beginTime'].' ~ '.$data['endTime'];
- $result['status'] = $data['trialStatusName'];
- $result['grade'] = $data['grade'];
- $result['goodsTypeId'] = $data['orderGoods']['goodsTypeId'];
- $result['startDate'] = $data['beginTime'];
- $result['enableNum'] = $data['enableNum'];
- }
- return $result;
- }
- /**
- * 正式订单列表
- */
- public function actionOfficialTable()
- {
- $page = Req::get('page')?Req::get('page'):1;
- $result = array();
- $params = array();
- if(Req::get('goodsId')){
- $params['goodsId'] = Req::get('goodsId');
- }
- if(Req::get('packageId')){
- $params['packageId'] = Req::get('packageId');
- }
- if(Req::get('status')){
- $params['status'] = Req::get('status')-1;
- }
- if(Req::get('orderType')){
- $params['orderType'] = Req::get('orderType')-1;
- }
- //获取产品
- $goodArr = $this->getGood();
- $result['goodList'] = $goodArr;
- //获取审核字典
- $dict = $this->getDict('process_apply_status');
- $result['applyStatus'] = $dict;
- $http = http('order/coach/officials/'.$page, 'POST', $this->authUsername, $params);
- $response = formatResponse($http);
- $data = $response['data'];
- if($response['status']){
- $result['page'] = $data;
- $result['list'] = isset($data['list'])?$data['list']:array();
- }else{
- $result['page'] = array();
- $result['list'] = array();
- }
- // debug($result);
- $this->render('officialTable', $result);
- }
- /**
- * @return string
- * 订购页面
- */
- public function actionOrderOfficial()
- {
- $orderId = Req::get('orderId');
- $goodDetail = $this->getOfficialOrderDetail($orderId);
- $this->render('orderOfficial', array('orderId'=>$orderId,'goodDetail'=>$goodDetail));
- }
- /**
- * 提交订购
- */
- public function actionSaveOfficial()
- {
- $studentIdArr = Req::post('studentList');
- $params['orderId'] = Req::post('orderId');
- $students = array();
- foreach ($studentIdArr as $k=>$v){
- $value = explode('#',$v);
- if(count($value)==4){
- $students[$k]['studentName'] = trim($value[0]);
- $students[$k]['studentId'] = trim($value[1]);
- $students[$k]['clazzName'] = trim($value[2]);
- $students[$k]['clazzId'] = trim($value[3]);
- }
- }
- $params['students'] = $students;
- $http = http('order/coach/official/students','post', $this->authUsername, $params);
- $response = formatResponse($http);
- $this->imsLog("正式订单-订购",'order/coach/trial',$params,$response);
- if($response['status']){
- returnMsg(1,'提交成功');
- }else{
- returnMsg(0,$response['data']);
- }
- }
- /**
- * 正式订单 催办
- */
- public function actionUrge()
- {
- $params = array(
- 'userId'=> $this->coachId,
- 'businessKey'=> Req::post('businessKey'),
- 'smeDesc'=> Req::post('smeDesc'),
- );
- $http = http('message/coach/urge', 'post', $this->authUsername, $params);
- $response = formatResponse($http);
- $this->imsLog("正式订单-催办",'message/coach/urge',$params,$response);
- if ($response['status']){
- returnMsg(1, '提交成功!');
- }else{
- returnMsg(0, $response['data']);
- }
- }
- /**
- * 正式订单取消
- */
- public function actionStop()
- {
- $businessKey = Req::post('businessKey');
- $title = Req::post('title');
- $http = http('activiti/coach/process-instances/'.$businessKey.'/suspended', 'put', $this->authUsername);
- $response = formatResponse($http);
- $this->imsLog($title,'activiti/coach/process-instances/'.$businessKey.'/suspended',array(),$response);
- if ($response['status']){
- returnMsg(1, '提交成功!');
- }else{
- returnMsg(0, $response['data']);
- }
- }
- /**
- * 正式订单删除
- */
- public function actionDelete()
- {
- $businessKey = Req::post('businessKey');
- $title = Req::post('title');
- $http = http('activiti/coach/process-instances/'.$businessKey, 'delete', $this->authUsername);
- $response = formatResponse($http);
- $this->imsLog($title,'activiti/coach/process-instances/'.$businessKey,array(),$response);
- if ($response['status']){
- returnMsg(1, '提交成功!');
- }else{
- returnMsg(0, $response['data']);
- }
- }
- /**
- * @return string
- * 明细订单
- */
- public function actionDetailOrder()
- {
- $params = array();
- $page = Req::get('page')?Req::get('page'):1;
- if (Req::get('orderNo')){
- $params['orderOfficialNo'] = Req::get('orderNo');
- }
- if (Req::get('orderOfficialNo')){
- $params['orderOfficialNo'] = Req::get('orderOfficialNo');
- }
- if(Req::get('goodsId')){
- $params['goodsId'] = Req::get('goodsId');
- }
- if(Req::get('packageId')){
- $params['packageId'] = Req::get('packageId');
- }
- if(Req::get('useStatus')){
- $params['useStatus'] = Req::get('useStatus')-1;
- }
- if(Req::get('payStatus')){
- $params['payStatus'] = Req::get('payStatus')-1;
- }
- if(Req::get('takeStatus')){
- $params['takeStatus'] = Req::get('takeStatus')-1;
- }
- if(Req::get('studentName') && Req::get('studentName')!=''){
- $params['studentName'] = Req::get('studentName');
- }
- if(Req::get('orderTypes')){
- $params['orderType'] = Req::get('orderTypes')-1;
- }
- if(Req::get('semesterTypes')){
- $params['semester'] = Req::get('semesterTypes')-1;
- }
- if(Req::get('schoolYearName') && Req::get('schoolYearName')!=''){
- $params['schoolYearId'] = Req::get('schoolYearName');
- }
- if(Req::get('className') && Req::get('className')!=''){
- $params['clazzName'] = Req::get('className');
- }
- if(Req::get('beginTime') && Req::get('beginTime')!=''){
- $params['beginTime'] = date('Y-m-d H:i:s',strtotime(Req::get('beginTime')));
- }
- if(Req::get('endTime') && Req::get('endTime')!=''){
- $params['endTime'] = date('Y-m-d 23:59:59',strtotime(Req::get('endTime')));
- }
- //获取产品
- $goodArr = $this->getGood();
- $result['goodList'] = $goodArr;
- //获取学年
- $http = http('sys/school/year/period/list', 'get', $this->authUsername);
- $response = formatResponse($http);
- $result['schoolYear'] = $response['data'];
- // debug($params);
- $http = http('order/coach/official/details/'.$page,'post', $this->authUsername, $params);
- $response = formatResponse($http);
- $data = $response['data'];
- if($response['status']){
- $result['page'] = $data;
- $result['list'] = $data['list'];
- }else{
- $result['page'] = array();
- $result['list'] = array();
- }
- $this->render('detailOrder', $result);
- }
- /**
- * @return string
- * 意向订单
- */
- public function actionPurposeTable()
- {
- $result = array();
- $params = array();
- $page = Req::get('page')?Req::get('page'):1;
- if(Req::get('schoolYearId')){
- $params['schoolYearId'] = Req::get('schoolYearId');
- }
- if(Req::get('goodsId')){
- $params['goodsId'] = Req::get('goodsId');
- }
- if(Req::get('beginTime')){
- $params['beginTime'] = Req::get('beginTime');
- }
- if(Req::get('endTime')){
- $params['endTime'] = Req::get('endTime');
- }
- if(Req::get('purposeOrderNo')){
- $params['orderNo'] = Req::get('purposeOrderNo');
- }
- //获取学年
- $http = http('sys/school/year/period/list', 'get', $this->authUsername, $params);
- $response = formatResponse($http);
- $result['schoolYear'] = $response['data'];
- //获取产品
- $goodArr = $this->getGood();
- $result['goodList'] = $goodArr;
- $http = http('order/coach/purposes/'.$page, 'post', $this->authUsername, $params);
- $response = formatResponse($http);
- $data = $response['data'];
- if($response['status']){
- $result['page'] = $data;
- $result['list'] = $data['list'];
- }else{
- $result['page'] = array();
- $result['list'] = array();
- }
- //debug($result);
- $this->render('purposeTable', $result);
- }
- /**
- * 意向订单转正式订单
- */
- public function actionToOfficial()
- {
- $params = array();
- if(Req::post('orderId')){
- $params['orderId'] = Req::post('orderId');
- }else{
- returnMsg(0,'orderId必须');
- }
- if(Req::post('officialNum')){
- $params['officialNum'] = Req::post('officialNum');
- }else{
- returnMsg(0,'officialNum必须');
- }
- $http = http('order/coach/purpose/to/official', 'post', $this->authUsername, $params);
- $response = formatResponse($http);
- $this->imsLog("意向订单-转正式订单",'order/coach/purpose/to/official',$params,$response);
- if ($response['status']){
- returnMsg(1,'操作成功');
- }else{
- returnMsg(0,$response['data']);
- }
- }
- /**
- * 意向订单转正式订单(重新提交)
- */
- public function actionReToOfficial()
- {
- $params = array();
- if(Req::post('orderId')){
- $params['orderOfficialId'] = Req::post('orderId');
- }else{
- returnMsg(0,'orderId必须');
- }
- if(Req::post('officialNum')){
- $params['officialNum'] = Req::post('officialNum');
- }else{
- returnMsg(0,'officialNum必须');
- }
- $http = http('order/coach/purpose/re-to/official', 'post', $this->authUsername, $params);
- $response = formatResponse($http);
- $this->imsLog("意向订单-重新提交",'order/coach/purpose/re-to/official',$params,$response);
- if ($response['status']){
- returnMsg(1,'操作成功');
- }else{
- returnMsg(0,$response['data']);
- }
- }
- /**
- * @return array
- * 获取订单详情-正式订单
- */
- public function getOfficialOrderDetail($orderId)
- {
- $result = array();
- $useDates = array();
- $http = http('order/coach/official/detail/'.$orderId,'get', $this->authUsername);
- $response = formatResponse($http);
- if ($response['status']){
- $data = $response['data'];
- $useDateArr = $data['orderGoods']['goodsPackageTimes'];
- foreach ($useDateArr as $k=>$v){
- $useDates[] = $v['timeName'];
- }
- $result['goodName'] = $data['orderGoods']['goodsName'];
- $result['packageName'] = $data['orderGoods']['goodsPackageName'];
- $result['useDate'] = implode(',',$useDates);
- $result['grade'] = $data['grade'];
- }
- return $result;
- }
- /**
- * 获取班级列表
- */
- public function actionGetClassList()
- {
- if (Req::post('grade')) {
- $grade = Req::post('grade');
- } else {
- $grade = 1;
- }
- $subjectId=Req::post('subjectId');
- $coachId = $this->coachId;
- $semesterId = $this->semesterId;
- $condition = "semester_id={$semesterId} AND grade={$grade} ";
- //判断是否开通走班
- if($subjectId){
- $classified=$this->schoolManager->getClassifiedBySubject($grade,$subjectId,$semesterId);
- if(!$classified || $classified['status']==0){
- $condition = "semester_id={$semesterId} AND grade={$grade} and class_type=1 ";
- }else{
- $condition = "semester_id={$semesterId} AND grade={$grade} and class_type=2 ";
- }
- }else{
- $condition = "semester_id={$semesterId} AND grade={$grade} ";
- }
- $select = 'class_id,class_name';
- $classList = SClass::model()->getClassList($select, $condition);
- if ($classList) {
- returnMsg(1, 'success', $classList);
- } else {
- returnMsg(0, '暂无数据');
- }
- }
- /**
- * 获取班级列表
- */
- public function actionGetClassListForClassifed()
- {
- if (Req::post('grade')) {
- $grade = Req::post('grade');
- } else {
- $grade = 1;
- }
- $subject=Req::post('subject');
- $coachId = $this->coachId;
- $semesterId = $this->semesterId;
- if(!$subject){
- //读取走班设置
- $result=array();
- $subjects=array();
- $classified=$this->sConn->createCommand("select subject_id from classified where grade='{$grade}' and semester_id='{$semesterId}' and status=1")->queryAll();
- if($classified){
- foreach ($classified as $val){
- $subjects[]=array(
- 'id'=>$val['subject_id'],
- 'name'=>Yii::app()->params['subjectId'][$val['subject_id']]
- );
- }
- }
- $result['subjects']=$subjects;
- $condition = "semester_id={$semesterId} AND grade={$grade} and class_type=1";
- $select = 'class_id,class_name';
- $classList = SClass::model()->getClassList($select, $condition);
- $result['classList']=$classList;
- if ($result) {
- returnMsg(1, 'success', $result);
- } else {
- returnMsg(0, '暂无数据');
- }
- }else{
- //读取走班学科班级
- $classData=$this->sConn->createCommand("select c.class_id,class_name from class c join class_subject_relation csr on c.class_id=csr.class_id where csr.subject_id='{$subject}' and c.class_type=2 and grade='{$grade}'")->queryAll();
- if($classData){
- returnMsg(1, 'success', $classData);
- }else{
- returnMsg(0, '暂无数据');
- }
- }
- }
- /**
- * 获取学生信息
- */
- public function actionGetStudent()
- {
- $result = array();
- $students = array();
- if (Req::post('classId')) {
- $classId = Req::post('classId');
- } else {
- returnMsg(0, 'classId必须');
- }
- $subjectId = Req::post('subjectId');
- if(!$subjectId){
- returnMsg(0, 'subjectId必须');
- }
- $studentName=Req::post('studentName');
- $trialType=Req::post('trialType');
- $semesterId=Req::post('semesterId');
- $grade=Req::post('grade');
- $startTime=Req::post('startTime');
- if($trialType==-1){
- returnMsg(0, '试用订单类型必须');
- }
- $studentIds=array();
- $list = SStudentClassRelation::model()->getStudentInfoByClassId($classId,$studentName);
- if($list){
- foreach ($list as $val){
- $studentIds[]=$val['student_id'];
- }
- }
- //获取本赛季已经开通的学生(页面需要 disabled)
- $currSeason = $this->getCurrentSeason();
- $studentArr = $this->getTrialStudentByStudentList($semesterId,$currSeason['schoolYearId'], Req::post('goodsTypeId'),$classId,$subjectId,$studentIds,$trialType,$grade,$startTime,$currSeason['semesterId']);
- if ($studentArr){
- foreach ($studentArr as $k=>$v)
- {
- $students[] = $v['studentId'];
- }
- }
- arrayMsort($list,'realname');
- if ($list) {
- $result['list'] = $list;
- $result['student'] = $students;
- returnMsg(1, 'success', $result);
- } else {
- returnMsg(0, '暂无数据');
- }
- }
- /**
- * 获取学生信息(正式订单)
- */
- public function actionGetOfficialStudent()
- {
- $result = array();
- $students = array();
- if (Req::post('classId')) {
- $classId = Req::post('classId');
- } else {
- returnMsg(0, 'classId必须');
- }
- $list = SStudentClassRelation::model()->getStudentInfoByClassId($classId);
- //获取本赛季已经开通的学生
- $studentArr = $this->getOfficialStudent(Req::post('orderId'), $classId);
- if ($studentArr){
- foreach ($studentArr as $k=>$v)
- {
- $students[] = $v['studentId'];
- }
- }
- if ($list) {
- $result['list'] = $list;
- $result['student'] = $students;
- returnMsg(1, 'success', $result);
- } else {
- returnMsg(0, '暂无数据');
- }
- }
- /**
- * @return array
- * 获取商品
- */
- public function getGood()
- {
- $result = array();
- $http = http('goods/up/list?schoolId='.$this->schoolId, 'get', $this->authUsername);
- $response = formatResponse($http);
- if($response['status']){
- $result = $response['data'];
- }
- return $result;
- }
- /**
- * @param $seasonId
- * @param $goodsTypeId
- * @param $classId
- * @return array
- * 获取已经订购的学生(意向订单)
- */
- public function getTrialStudent($semesterId,$schoolYearId, $goodsTypeId, $classId,$subjectId)
- {
- $http = http('order/coach/trial/'.$schoolYearId.'/'.$semesterId.'/'.$goodsTypeId.'/'.$classId.'/'.$subjectId.'/students', 'get', $this->authUsername);
- $response = formatResponse($http);
- if($response['status']){
- return $response['data'];
- }else{
- return array();
- }
- }
- /**
- * @param $seasonId
- * @param $goodsTypeId
- * @param $classId
- * @return array
- * 获取已经订购的学生(正式订单)
- */
- public function getOfficialStudent($orderId, $classId)
- {
- $http = http('order/coach/official/'.$orderId.'/'.$classId.'/students', 'get', $this->authUsername);
- $response = formatResponse($http);
- if($response['status']){
- return $response['data'];
- }else{
- return array();
- }
- }
- /**
- * 获取字典
- */
- public function getDict($codeType)
- {
- $result = array();
- $http = http('dictionary/list/type-code/'.$codeType, 'get', $this->authUsername);
- $response = formatResponse($http);
- if ($response['status']){
- $result = $response['data'];
- }
- return $result;
- }
- /**
- * 获取所有启用的销售赛季
- */
- public function getEnableSeason()
- {
- $result = array();
- $http = http('sales-season/enables', 'get', $this->authUsername);
- $response = formatResponse($http);
- if ($response['status']){
- $result = $response['data'];
- }
- return $result;
- }
- /**
- * 获取所有启用的销售学期
- */
- public function getEnableImsSemester()
- {
- $result = array();
- $http = http('sys/school/year/semester/list', 'get', $this->authUsername);
- $response = formatResponse($http);
- if ($response['status']){
- $result = $response['data'];
- }
- return $result;
- }
- /**
- * @return array
- * 获取商品类别
- */
- public function getGoodType()
- {
- $result = array(
- array(
- 'goodsTypeId'=> 1,
- 'goodsTypeName'=> '错题本'
- ),
- array(
- 'goodsTypeId'=> 2,
- 'goodsTypeName'=> '个性化学习方案'
- ),
- array(
- 'goodsTypeId'=> 3,
- 'goodsTypeName'=> '个性化学习宝'
- ),
- );
- return $result;
- }
- /**
- * @return array
- * 获取套餐
- */
- public function actionGetPackages()
- {
- $goodsId = Req::post('goodsId');
- $http = http('goods/packages/'.$goodsId, 'GET', $this->authUsername);
- $response = formatResponse($http);
- if ($response['status']){
- returnMsg(1,'success', $response['data']);
- }else{
- returnMsg(0, $response['data']);
- }
- }
- /**
- * 确认收货提示
- */
- public function actionConfirmWaning(){
- $msg = '<table border="1">';
- $hasMessage=0;
- //收货提醒
- $http = http('storage-allocate/coach/warning', 'GET', $this->authUsername);
- $response = formatResponse($http);
- if($response['status'] && $response['data']){
- $hasMessage=1;
- $url = Yii::app()->createUrl('imsStore/allocation');
- $msg .= '<tr><td><div style="padding:10px 20px;"><p style="line-height:30px;color:#619aff;">确认收货提醒</p></div></td><td>已经有发货5天尚未确认收货的调拨单,请在到货后确认收货,如对物流有疑问,请联系总部 </td><td><div style="padding:10px 20px;"><a style="color:blue;" href='.$url.'>立即处理</a></div></td></tr>';
- }
- //清洁提醒
- $http = http('equip/plan/coach/cleanCommitWarning', 'GET', $this->authUsername);
- $response1 = formatResponse($http);
- if($response1['status'] && $response1['data']){
- $hasMessage=1;
- $url = Yii::app()->createUrl('imsDevice/taskClean');
- $msg .= '<tr><td><div style="padding:10px 20px;"><p style="line-height:30px;color:#619aff;">清洁任务提醒</p></div></td><td>你有待提交的清洁任务,请及时处理,否则会判定为不合格 </td><td><div style="padding:10px 20px;"><a style="color:blue;" href='.$url.'>立即处理</a></div></td></tr>';
- }
- //发货提醒
- $http = http('storage-allocate/coach/deliverWarning', 'GET', $this->authUsername);
- $response2 = formatResponse($http);
- if($response2['status'] && $response2['data']){
- $hasMessage=1;
- $url = Yii::app()->createUrl('imsStore/allocation');
- $msg .= '<tr><td><div style="padding:10px 20px;"><p style="line-height:30px;color:#619aff;">调拨单提醒</p></div></td><td>您有待发货的调拨单,请及时处理 </td><td><div style="padding:10px 20px;"><a style="color:blue;" href='.$url.'>立即处理</a></div></td></tr>';
- }
- //问调表
- $http = http('storage-allocate/coach/experience-remind', 'GET', $this->authUsername);
- $response2 = formatResponse($http);
- if($response2['status'] && $response2['data']){
- $hasMessage=1;
- foreach ($response2['data'] as $datum){
- $id = $datum['id'];
- $fixedCode= $datum['fixedCode'];
- $msg .= '<tr><td><div style="padding:10px 20px;"><p style="line-height:30px;color:#619aff;">问调表提醒</p></div></td><td>您有设备问调表待填写,请及时处理 </td><td><div style="padding:10px 20px;"><a style="color:blue;" href="#" id="'.$id.'" fixedCode="'.$fixedCode.'" class="survey">立即处理</a></div></td></tr>';
- }
- }
- $msg .= '</table>';
-
- returnMsg(1,$msg, $hasMessage);
- // if ($response['status']){
- // returnMsg(1,'success', $response['data']);
- // }else{
- // returnMsg(0, $response['data']);
- // }
- }
- /**
- * 清洁消息提示
- */
- public function actionCleanConfirmWaning(){
- $http = http('storage-allocate/coach/deliverWarning', 'GET', $this->authUsername);
- $response = formatResponse($http);
- if ($response['status']){
- returnMsg(1,'success', $response['data']);
- }else{
- returnMsg(0, $response['data']);
- }
- }
- /**
- * 发货提示
- */
- public function actionSendConfirmWaning(){
- $http = http('equip/plan/coach/cleanCommitWarning', 'GET', $this->authUsername);
- $response = formatResponse($http);
- if ($response['status']){
- returnMsg(1,'success', $response['data']);
- }else{
- returnMsg(0, $response['data']);
- }
- }
- /**
- *意向订单转正式订单
- */
- public function actionFormalOrder(){
- $orderNo = Req::get('orderNo'); //订单号
- $goodsName = Req::get('goodsName'); //商品名
- // $grade = Req::get('grade'); //年级
- $surplus = Req::get('surplus'); //剩余
- $goodsTypeId=Req::get('goodsTypeId');
- $orderId=Req::get('orderId');
- $schoolYear=Req::get('schoolYear');
- $useGrade=Req::get('useGrade');
- $result['orderNo']=$orderNo;
- $result['goodsName']=$goodsName;
- $result['surplus']=$surplus;
- $result['goodsTypeId']=$goodsTypeId;
- $result['orderId']=$orderId;
- $result['schoolYear']=$schoolYear;
- $result['useGrade']=$useGrade;
- //根据级别,计算当前所在年级
- $grade=1;
- $semester=$this->schoolManager->getSemester($this->semesterId);
- $nowSemesterSchoolYear=$semester['school_year'];
- if(Yii::app()->params['grade_list']){
- foreach (Yii::app()->params['grade_list'] as $id =>$param){
- $gradeText[$id]=$param['grade_name'];
- }
- }
- if(Yii::app()->params['section']==0){
- $addValue=7;
- // if(Yii::app()->params['grade_group_fixed_year']==4){
- // $addValue=6;
- // }else{
- // $addValue=7;
- // }
- if(strpos($semester['semester_name'],'上学期')!==false){
- $grade=intval($nowSemesterSchoolYear-$schoolYear+$addValue);
- }elseif(strpos($semester['semester_name'],'下学期')!==false || strpos($semester['semester_name'],'暑假')!==false || strpos($semester['semester_name'],'寒假')!==false){
- $grade=intval($nowSemesterSchoolYear-$schoolYear+$addValue-1);
- }
- }else{
- if(strpos($semester['semester_name'],'上学期')!==false){
- $grade=intval($nowSemesterSchoolYear-$schoolYear+1);
- }elseif(strpos($semester['semester_name'],'下学期')!==false || strpos($semester['semester_name'],'暑假')!==false || strpos($semester['semester_name'],'寒假')!==false){
- $grade=intval($nowSemesterSchoolYear-$schoolYear);
- }
- }
- if(!isset($gradeText[$grade])){
- Yii::app()->jump->error("获取订单数据异常,学年不正确");
- }
- $result['grade']=$grade;
- $result['gradeText']=$gradeText[$grade];
- $this->render('formalOrder', $result);
- }
- //申请转正
- public function actionTurnOrder(){
- $orderId=Req::post('orderId');
- $officialNum=Req::post('officialNum');
- $students=Req::post('studentInfo');
- $suplus=Req::post('suplus');
- $students=str_replace('"','"',$students);
- @$studentIdArr=json_decode($students,true);
- if(!$studentIdArr){
- returnMsg(0,'学生数据解析失败');
- }
- if(count($studentIdArr) > $suplus) {
- returnMsg(0,'学生人数不能大于剩余名额');
- }
- $studentInfo=array();
- $rex = "/\([\s\S]*\)/i"; //过滤括号
- foreach ($studentIdArr as $val){
- if(!$val['class'] || !$val['classId'] || !$val['value'] || !$val['name']){
- continue;
- }
- $studentName=preg_replace($rex,"",$val['name']);
- $temp=array(
- 'clazzId'=>$val['classId'],
- 'clazzName'=>$val['class'],
- 'studentId'=>$val['value'],
- 'studentName'=>$studentName
- );
- $studentInfo[]=$temp;
- }
-
- $params['orderId']=$orderId;
- $params['officialNum']=$officialNum;
- $params['students']=$studentInfo;
- $http = http('order/coach/purpose/to/official/v2', 'post', $this->authUsername, $params);
- $response = formatResponse($http);
- if ($response['status']){
- returnMsg(1,'success', $response['data']);
- }else{
- returnMsg(0, $response['data']);
- }
- }
- //查看正式订单申请
- public function actionViewTurnOrder(){
- $goodsName=Req::get('goodsName');
- $gradeText=Req::get('gradeText');
- $surplus=Req::get('surplus');
- $orderNo=Req::get('orderNo');
- $orderId=Req::get('orderId');
- $page=Req::get('page');
- $quantity=Req::get('quantity');
- if(!$page) $page=1;
- $params['orderOfficialNo']=$orderNo;
- $http = http('order/coach/official/details/'.$page, 'post', $this->authUsername, $params);
- $response = formatResponse($http);
- //请求日志
- $log = http('order/coach/official/detail/'.$orderId, 'get', $this->authUsername, array());
- $logList=formatResponse($log);
- if(isset($logList['data']['orderLogs'])){
- $result['logList']=$logList['data']['orderLogs'];
- }else{
- $result['logList']=array();
- }
- //debug($result['logList']['data']['orderLogs']);
- $result['quantity']=$quantity;
- $result['orderNo']=$orderNo;
- $result['goodsName']=$goodsName;
- $result['surplus']=$surplus;
- $result['gradeText']=$gradeText;
- $result['pages']=$response['data']['pages'];
- $result['list']=$response['data']['list'];
- $result['page']=$page;
- $result['total']=$response['data']['total'];
- $pageArr=array(
- 'goodsName'=>$goodsName,
- 'gradeText'=>$gradeText,
- 'surplus'=>$surplus,
- 'orderNo'=>$orderNo,
- 'quantity'=>$quantity
- );
- $result['query']=http_build_query($pageArr);
- $this->render('viewFormalOrder', $result);
- }
- /**
- * 获取学生信息
- */
- public function actionGetFilterStudent()
- {
- $result = array();
- $students = array();
- if (Req::post('classId')) {
- $classId = Req::post('classId');
- } else {
- returnMsg(0, 'classId必须');
- }
- $studentName=Req::post('studentName');
- $orderId=Req::post('orderId');
- $list = SStudentClassRelation::model()->getStudentInfoByClassId($classId,$studentName);
- arrayMsort($list,'realname');
- //获取本赛季已经开通的学生(页面需要 disabled)
- $http = http('order/coach/official/students/'.$orderId, 'get', $this->authUsername);
- $response = formatResponse($http);
- if($response['status']){
- $studentArr= $response['data'];
- }else{
- $studentArr=array();
- }
-
- if ($studentArr){
- foreach ($studentArr as $k=>$v)
- {
- $students[] = $v;
- }
- }
- if ($list) {
- $result['list'] = $list;
- $result['student'] = $students;
- returnMsg(1, 'success', $result);
- } else {
- returnMsg(0, '暂无数据');
- }
- }
- public function actionCloudPrintTask()
- {
- $centerId = Req::get('centerId') ? Req::get('centerId') : 0 ;
- $status = Req::get('status') > -1 ? Req::get('status') : -1 ;
- $goodsTypeId = Req::get('goodsTypeId') ? Req::get('goodsTypeId') : 0 ;
- $subjectId = Req::get('subjectId') ? Req::get('subjectId') : 0 ;
- $clazzName = Req::get('clazzName');
- $taskName = Req::get('taskName');
- $page = Req::get('page');
- if(!$page) $page=1;
- $http = http('cloud-print/task/coach/cloud-product/all', 'get', $this->authUsername, array());
- $response = formatResponse($http);
- $productList = array();
- if(isset($response['data']) && $response['data']){
- foreach ($response['data'] as $val){
- if(!$val['isShow']){
- $productList[$val['productId']] = $val['productName'];
- }
- }
- }
- $params = array();
- $params['centerId'] = $centerId;
- $params['status'] = $status;
- $params['goodsTypeId'] = $goodsTypeId;
- $params['subjectId'] = $subjectId;
- $params['clazzName'] = $clazzName;
- $params['taskName'] = $taskName;
- $params['pageNum'] = $page;
- $params['pageSize'] = 20;
- $http = http('cloud-print/task/coach/page', 'post', $this->authUsername, $params);
- $response = formatResponse($http);
- $result['centerId'] =$centerId;
- $result['status'] =$status;
- $result['goodsTypeId']=$goodsTypeId;
- $result['productList']=$productList;
- $result['subjectId'] =$subjectId;
- $result['clazzName']=$clazzName;
- $result['taskName'] =$taskName;
- $result['pages'] =$response['data'];
- $result['list'] =$response['data']['list'];
- $result['page'] =$page;
- $result['total'] =$response['data']['total'];
- $pageArr=array(
- 'centerId '=> $centerId,
- 'status' => $status,
- 'goodsTypeId'=> $goodsTypeId,
- 'subjectId' => $subjectId,
- 'clazzName' => $clazzName,
- 'taskName' => $taskName
- );
- $result['query']=http_build_query($pageArr);
- $print_centers = array();
- $print_centers_query = http('cloud-print/task/coach/center/list', 'get', $this->authUsername);
- $print_centers_query = formatResponse($print_centers_query);
- if(!empty($print_centers_query['data']))
- {
- foreach($print_centers_query['data'] as $print_center)
- {
- $print_centers[$print_center['centerId']] = $print_center['centerName'];
- }
- }
- $result['print_centers'] = $print_centers;
- $this->render('cloudPrintTask', $result);
- }
- public function actionTaskDetail()
- {
- $task_id = Req::get('task_id');
- $http = http('cloud-print/task/coach/detail/'.$task_id, 'get', $this->authUsername);
- $response = formatResponse($http);
- $this->render('taskDetail', $response);
- }
- public function actionTaskCancel()
- {
- $task_id = Req::post('task_id');
- $res = http('cloud-print/task/coach/return/'.$task_id, 'put', $this->authUsername);
- $res = formatResponse($res);
- if($res['status'] == 1)
- {
- $cptp_info = \BusinessCloudPrintTask::model()->find('cloud_print_id=:cloud_print_id',array(':cloud_print_id' => $task_id));
- if(!empty($cptp_info)) Yii::app()->cache->deleteValue($cptp_info['redis_key']);
- }
- returnMsg($res['status'], $res['data']);
- }
- public function actionTaskReceive()
- {
- $task_id = Req::post('task_id');
- $res = http('cloud-print/task/coach/receive/'.$task_id, 'put', $this->authUsername);
- $res = formatResponse($res);
- returnMsg($res['status'], $res['data']);
- }
- public function actionTaskDelete()
- {
- $task_id = Req::post('task_id');
- $res = http('cloud-print/task/coach/delete/'.$task_id, 'delete', $this->authUsername);
- $res = formatResponse($res);
- returnMsg($res['status'], $res['data']);
- }
- public function actionTaskPReceive()
- {
- $task_ids = Req::post('task_ids');
- $param['taskIds'] = $task_ids;
- $res = http('cloud-print/task/coach/receive/batch', 'put', $this->authUsername, $param);
- $res = formatResponse($res);
- returnMsg($res['status'], $res['data']);
- }
- public function actionContingencyPrint()
- {
- $this->render('contingencyPrint');
- }
- //保存应急打印任务
- public function actionSaveContingencyPrint()
- {
- ini_set ('memory_limit', '300M');
- if(!$_FILES)
- {
- echo json_encode(array('status' => 0, 'message' => '文件大小超过范围'));exit;
- }else{
- if(!isset($_FILES['file1']) || !isset($_FILES['file1']['size']) || $_FILES['file1']['size'] > 10485760)
- {
- echo json_encode(array('status' => 0, 'message' => '文件大小超过范围'));exit;
- }
- $info = $_FILES['file1']['name'];
- $temp = explode('.', $info);
- $type = end($temp);
- $fileType = array('rar', 'zip');
- if (!in_array($type, $fileType)) {
- echo json_encode(array('status' => 0, 'message' => '请上传指定类型文件'));exit;
- }
- }
- if (Yii::app()->request->getIsPostRequest())
- {
- // 保存上传文件至服务器
- $pathName = dirname(dirname(dirname(__FILE__))).'/upload/tmpDir/ims/cloudTask/'. $this->schoolId.date('Y') .'/'. date('m') . '/'.date('d'). '/';
- $pathName1 = 'upload/tmpDir/ims/cloudTask/'. $this->schoolId.date('Y') .'/'. date('m') . '/'.date('d'). '/';
- if (!file_exists($pathName))
- {
- mkdir($pathName, 0777, true);
- }
- $ucloud = new HuaweiCloud();
- $fileName = iconv("UTF-8", "gb2312",$_FILES['file1']['name']);
- $extName = substr($_FILES['file1']['name'],strrpos($_FILES['file1']['name'],'.'));
- if (!move_uploaded_file($_FILES['file1']['tmp_name'], $pathName.$fileName))
- {
- echo json_encode(array('status' => 0, 'message' => '文件上传失败'));
- @unlink($pathName1.$fileName);exit;
- }else{
- $meg = $ucloud->putFile('zsyas2/ims/cloudTask/'.$this->schoolId.'/'.time().mt_rand().$extName,$pathName1.$fileName);
- if($meg['status'] == 0){
- echo json_encode(array('status' => 0, 'message' => $meg['msg']));exit();
- }else{
- $url = $meg['url'];
- $url = str_replace("%2F","/",$url);
- }
- }
- @unlink($pathName1.$fileName);
- //任务发送ims端
- $params = array(
- "taskName" => Req::post('taskName'),
- "centerId" => $this->getPrintCenter(),
- 'subjectId' => Req::post('subject'),
- 'grade' => Req::post('grade'),
- 'printPieces' => Req::post('copies'),
- 'singlePiecePages' => Req::post('eachCopies'),
- 'sheetType' => Req::post('sheetType'),
- 'url' => $url,
- 'sendTime' => date('Y-m-d H:i:s')
- );
- $http = http('cloud-print/task/coach/add/emergency', 'POST', $this->authUsername, $params);
- $response = formatResponse($http);
- if ($response['status']) {
- echo json_encode(array('status' => 1, 'message' => 'ok'));exit;
- }else{
- echo json_encode(array('status' => 0, 'message' => $response['data']));exit;
- }
- }
- }
- //获取云印点
- protected function getPrintCenter(){
- //获取云印点
- if(Yii::app()->cache->getValue("cloud_print_coach_".$this->schoolId."_centerId"))
- {
- $centerId = Yii::app()->cache->getValue("cloud_print_coach_".$this->schoolId."_centerId");
- }else{
- $http1 = http('cloud-print/task/coach/center','GET', $this->authUsername, array());
- $response1 = formatResponse($http1);
- if(isset($response1['data']['centerId']) && is_numeric($response1['data']['centerId'])){
- $centerId = $response1['data']['centerId'];
- Yii::app()->cache->setValue("cloud_print_coach_".$this->schoolId."_centerId", $centerId, 86400);
- }else{
- echo json_encode(array('status' => 0, 'message' => '获取云印点失败'));exit;
- }
- }
- return $centerId;
- }
- public function actionProductSign(){
- $type = Req::get('type');
- $begin = Req::get('begin');
- $end = Req::get('end');
- $name = Req::get('name');
- $page=Req::get('page');
- if(!$page) $page=1;
- $result=array();
- $result['list']=array();
- $result['page']=array();
- $param=array();
- $param['page']=$page;
- if($type){
- $param['type']=$type;
- }
- if($begin){
- if(strtotime($begin)>time()){
- Yii::app()->jump->error('开始时间不能大于当前时间');
- }
- $param['begin']=date('Y-m-d H:i:s',strtotime($begin));
- }
- if($end){
- if(strtotime($end)>time()){
- Yii::app()->jump->error('结束时间不能大于当前时间');
- }
- $param['end']=date('Y-m-d H:i:s',(strtotime($end)+86400));
- }
- if($name){
- $param['name']=$name;
- }
- $res = http('order/deliver/coach/query', 'post', $this->authUsername, $param);
- $res = formatResponse($res);
- if($res['status']==1){
- $result['list']=$res['data']['list'];
- $result['page']=$res['data'];
- //读取AndroidApp下载链接
- $softwareUrlAndroid=$this->schoolManager->getNewVersionBySoftwareId(12);
- $result['softwareUrlAndroid']=$softwareUrlAndroid;
- $result['softwareUrlIos']='https://testflight.apple.com/join/o0NJOqbz';
- $this->render('productSign', $result);
- }else{
- Yii::app()->jump->error($res['data']);
- }
- }
- public function actionViewProductSign(){
- $id = Req::get('id');
- $res = http('order/deliver/coach/detail/'.$id, 'get', $this->authUsername);
- $res = formatResponse($res);
- if($res['status']==1){
- $this->render('viewProductSign',$res['data']);
- }else{
- Yii::app()->jump->error("接口错误");
- }
- }
- /**
- * @param $seasonId
- * @param $goodsTypeId
- * @param $classId
- * @return array
- * 获取已经订购的学生(意向订单)
- */
- public function getTrialStudentByStudentList($yearSemester,$schoolYearId, $goodsTypeId, $classId,$subjectId,$studentList,$trialType,$grade,$startTime,$semesterId)
- {
- $param=array();
- $param['schoolYearId']=$schoolYearId;
- $param['semesterId']=$semesterId;
- $param['yearSemester']=$yearSemester;
- $param['clazzId']=$classId;
- $param['goodsTypeId']=$goodsTypeId;
- $param['subjectId']=$subjectId;
- $param['studentIds']=$studentList;
- $param['trialType']=$trialType;
- $param['grade']=$grade;
- $param['beginTime']=$startTime;
- $http = http('order/coach/trial/students', 'post', $this->authUsername,$param);
- $response = formatResponse($http);
- if($response['status']){
- return $response['data'];
- }else{
- return array();
- }
- }
-
- /**
- * 明细订单导出
- */
- public function actionDetailOrderExcel(){
- $params = array();
-
- // if (Req::post('orderNo')){
- // $params['orderOfficialNo'] = Req::post('orderNo');
- // }
- if (Req::post('orderOfficialNo')){
- $params['orderOfficialNo'] = Req::post('orderOfficialNo');
- }
- if(Req::post('goodsId')){
- $params['goodsId'] = Req::post('goodsId');
- }
- if(Req::post('packageId')){
- $params['packageId'] = Req::get('packageId');
- }
- if(Req::post('useStatus')){
- $params['useStatus'] = Req::post('useStatus')-1;
- }
- if(Req::post('payStatus')){
- $params['payStatus'] = Req::post('payStatus')-1;
- }
- if(Req::post('takeStatus')){
- $params['takeStatus'] = Req::post('takeStatus')-1;
- }
- if(Req::post('studentName') && Req::post('studentName')!=''){
- $params['studentName'] = Req::post('studentName');
- }
- if(Req::post('orderTypes')){
- $params['orderType'] = Req::post('orderTypes')-1;
- }
- if(Req::post('semesterTypes')){
- $params['semester'] = Req::post('semesterTypes')-1;
- }
- if(Req::post('schoolYearName') && Req::post('schoolYearName')!=''){
- $params['schoolYearId'] = Req::post('schoolYearName');
- }
- if(Req::post('className') && Req::post('className')!=''){
- $params['clazzName'] = Req::post('className');
- }
- if(Req::post('beginTime') && Req::post('beginTime')!=''){
- $params['beginTime'] = date('Y-m-d H:i:s',strtotime(Req::post('beginTime')));
- }
- if(Req::post('endTime') && Req::post('endTime')!=''){
- $params['endTime'] = date('Y-m-d 23:59:59',strtotime(Req::post('endTime')));
- }
- $http = http('order/coach/official/details/export','post', $this->authUsername, $params);
- $response = formatResponse($http);
- if($response){
- echo json_encode($response);exit;
- }else{
- echo json_encode(array("status"=>0,"error"=>"导出失败"));exit;
- }
- }
- public function actionGetStudentInfo(){
- $params = array();
- if (Req::post('studentName')){
- $params['studentName'] = Req::post('studentName');
- }
- if(Req::post('orderNo')){
- $params['orderNo'] = Req::post('orderNo');
- }
- $http = http('order/coach/trial/students/list', 'post', $this->authUsername, $params);
- $response = formatResponse($http);
- // debug($response);
- if($response){
- echo json_encode($response);exit;
- }else{
- echo json_encode(array("status"=>0,"error"=>"导出失败"));exit;
- }
- }
- /*
- *未签收产品列表7天内
- * 根据产品/考试id ,获取已下载的班级信息
- * type:1 考试,2数学阶段个性化学习宝,3二轮提分手册,4考后指导,5晨读词汇 6阶段复习,7错题本,8二步个性化学习宝,9三步个性化学习宝,10 英语外刊阅读
- * 1,2,4,6,7,8,9 考试类型
- */
- public function actionUnSign(){
- $postArr=array();
- $list=array();
- //查询7天内考试
- $examModel=new SExam();
- $examParam=$examModel->getExamIdByTime();
- //二轮提分指导手册
- $mathReviewModel=new SMathReviewSetting();
- $mathParam=$mathReviewModel->getMathReview();
- //晨读词汇
- $weekParam=$mathReviewModel->getEnglishWeek();
- //外刊阅读
- $readingParam=$mathReviewModel->getEnglishReading();
- $postArr=array_merge($examParam,$mathParam,$weekParam,$readingParam);
- // $postArr=array_merge($postArr,$mathParam);
- // $postArr=array_merge($postArr,$weekParam);
- // $postArr=array_merge($postArr,$readingParam);
- // debug(json_encode($postArr));
- //接口过滤已签名数据
- $http = http('order/deliver/coach/no-deliver/query', 'post', $this->authUsername, $postArr);
- $response = formatResponse($http);
-
- if($response['status']){
- $list= $response['data'];
- }
- $this->render('productUnSign',array('list'=>$list));
- }
- //回款反馈
- public function actionPayment(){
- $params = array();
- if(Req::get('grade')){
- $params['grade']=Req::get('grade');
- }
- if(Req::get('schoolYearId')){
- $params['schoolYearId']=Req::get('schoolYearId');
- }
- if(Req::get('goodsId')){
- $params['goodsId']=Req::get('goodsId');
- }
- if(Req::get('semester')){
- $params['semester']=Req::get('semester')-1;
- }
- if(Req::get('startTime')){
- $params['startTime']=Req::get('startTime').' 0:0:0';
- }
- if(Req::get('endTime')){
- $params['endTime']=Req::get('endTime').' 0:0:0';
- }
- if(Req::get('page')){
- $params['pageNum']=Req::get('page');
- }else{
- $params['pageNum']=1;
- }
- //列表
- $http = http('finance/back/coach/client/list', 'post', $this->authUsername, $params);
- $response = formatResponse($http);
- if($response['status']==1){
- $result['list']=$response['data']['list'];
- $result['page'] = $response['data'];
- }else{
- if(isset($response['data']) && $response['data']){
- Yii::app()->jump->error($response['data']);
- }else{
- Yii::app()->jump->error("保存失败");
- }
- }
- //获取学年
- $http = http('sys/school/year/period/list', 'get', $this->authUsername);
- $response = formatResponse($http);
- $result['schoolYear'] = $response['data'];
- $goodArr = $this->getGood();
- $result['goodList'] = $goodArr;
- $result['params']=$params;
- $this->render('paymentList',$result);
- }
- //新增回款反馈
- public function actionNewPayment(){
- if (Yii::app()->request->getIsPostRequest()){
- //保存
- $param['orderId']=Req::post('orderId');
- $param['useNum']=Req::post('use_person');
- $param['schoolYearId']=Req::post('schoolYearId');
- if(Req::post('semester')){
- $param['semester']=Req::post('semester')-1;
- }
- $param['grade']=Req::post('grade');
- $param['goodsId']=Req::post('goodsId');
- $param['downloadNum']=Req::post('down_person');
- $param['price']=Req::post('price');
- $param['feeNumUp']=Req::post('feeNumUp');
- $param['priceSumUp']=Req::post('priceSumUp');
- $param['feeNumDown']=Req::post('feeNumDown');
- $param['priceSumDown']=Req::post('priceSumDown');
- $param['feeTime']=date('Y-m-d H:i:s',strtotime(Req::post('charge_time')));
- if(Req::post('pay_time')){
- $param['remitDate']=date('Y-m-d H:i:s',strtotime(Req::post('pay_time')));
- }
- $param['remark']=Req::post('mark');
- if(Req::post('id')){
- $param['bcId']=Req::post('id');
- $http = http('finance/back/coach/edit', 'post', $this->authUsername,$param);
- }else{
- $http = http('finance/back/coach/add', 'post', $this->authUsername,$param);
- }
- $response = formatResponse($http);
-
- if($response['status']==1){
- $this->redirect('/imsSale/payment');
- }else{
- if(isset($response['data']) && $response['data']){
- Yii::app()->jump->error($response['data']);
- }else{
- Yii::app()->jump->error("保存失败");
- }
- }
- }
- $params = array();
- //销售订单列表
- $http = http('order/coach/purpose/list', 'get', $this->authUsername);
- $response = formatResponse($http);
- //debug($response);
- if($response['status']==1){
- $result['orderList']=$response['data'];
- }
- //获取学年
- $http = http('sys/school/year/period/list', 'get', $this->authUsername, $params);
- $response = formatResponse($http);
- $result['schoolYear'] = $response['data'];
- //debug($http);
- $goodArr = $this->getGood();
- $result['goodList'] = $goodArr;
- $this->render('newPayment',$result);
- }
- //编辑回款反馈
- public function actionEditPayment(){
- $id=Req::get('id');
- $http = http('finance/back/coach/'.$id, 'get', $this->authUsername);
- $response = formatResponse($http);
- //debug($response);
- if($response['status']==1){
- $result['data']=$response['data'];
- }
- //销售订单列表
- $http = http('order/coach/purpose/list', 'get', $this->authUsername);
- $response = formatResponse($http);
- if($response['status']==1){
- $result['orderList']=$response['data'];
- }
- //获取学年
- $http = http('sys/school/year/period/list', 'get', $this->authUsername);
- $response = formatResponse($http);
- $result['schoolYear'] = $response['data'];
- //debug($http);
- $goodArr = $this->getGood();
- $result['goodList'] = $goodArr;
- $this->render('editPayment',$result);
- }
- //服务费查询
- public function actionServiceCharge(){
- $data=array();
- $page=Req::get('page');
- $param=array();
- if(Req::get('semesterId')){
- $param['semesterId']=Req::get('semesterId')-1;
- }
- if(Req::get('schoolYearId')){
- $param['schoolYearId']=Req::get('schoolYearId');
- }
- if(Req::get('end')){
- $param['end']=Req::get('end')." 23:59:59";
- }
- if(Req::get('begin')){
- $param['begin']=Req::get('begin')." 00:00:00";
- }
- if(!$page) $page=1;
- $http = http('coach-service-charge/coach/batch/query?pageNum='.$page, 'post', $this->authUsername,$param);
- $response = formatResponse($http);
- if($response['status']=1){
- $data['list']=$response['data']['list'];
- $data['page']=$response['data'];
- }else{
- $data['list']=array();
- $data['page']=array();
- }
-
- //获取学年
- $http = http('sys/school/year/period/list', 'get', $this->authUsername);
- $response = formatResponse($http);
- $data['schoolYear'] = $response['data'];
- $this->render('serviceCharge',$data);
- }
- //商品变更
- public function actionGoodsChange(){
- $result=array();
- $seasonId=Req::get('seasonId');
- $begin=Req::get('begin');
- $end=Req::get('end');
- $status=Req::get('status');
- $page = Req::get('page') ? Req::get('page') : 1;
- $params=array();
- if($seasonId){
- $params['seasonId']=$seasonId;
- }
- if($begin){
- $params['begin']=$begin.' 00:00:00';
- }
- if($end){
- $params['end']=$end.' 23:59:59';
- }
- if($status){
- $params['status']=$status-1;
- }
- if($page){
- $params['pageNum']=$page;
- }
- //销售订单列表
- $http = http('order/goods/change/coach/page', 'post', $this->authUsername,$params);
- $response = formatResponse($http);
- if($response['status']==1){
- $result['list']=$response['data']['list'];
- $result['page']=$response['data'];
- }else{
- $result['list']=array();
- $result['page']=array();
- }
- $result['seasonId'] = $seasonId;
- $result['begin'] = $begin;
- $result['end'] = $end;
- $result['status'] = $status;
- //读取赛季
- $seasonList=$this->getEnableSeason();
- $result['seasonList']=$seasonList;
- $this->render('goodsChange',$result);
- }
- //查看服务费详情
- public function actionViewServiceCharge(){
- $batchId=Req::get('batchId');
- $data=array();
- //查询服务费核算结果
- $http = http('coach-service-charge/coach/batch/'.$batchId.'/query', 'get', $this->authUsername);
- $response = formatResponse($http);
- $data['batches']=$response['data'];
- //查询订单维度核算过程
- $http = http('coach-service-charge/coach/batch/'.$batchId.'/order/query?pageNum=1', 'get', $this->authUsername);
- $response = formatResponse($http);
- $data['order']=$response['data'];
- //查询本学期扣款记录
- $http = http('coach-service-charge/coach/deduction/query/'.$batchId.'?pageNum=1', 'get', $this->authUsername);
- $response = formatResponse($http);
- $data['recorder']=$response['data'];
- $this->render('viewServiceCharge',$data);
- }
- //查询订单维度核算过程
- public function actionAjaxSearchServiceCharge(){
- $batchId=Req::post('batchId');
- $page=Req::post('page');
- $type=Req::post('type');
- if(!$page) $page=1;
- if($type==1){
- //查询本学期扣款记录
- $http = http('coach-service-charge/coach/deduction/query/'.$batchId.'?pageNum='.$page, 'get', $this->authUsername);
- }else{
- //查询订单维度核算过程
- $http = http('coach-service-charge/coach/batch/'.$batchId.'/order/query?pageNum='.$page, 'get', $this->authUsername);
- }
- $response = formatResponse($http);
- returnMsg(1,'success',$response['data']);
- }
- //查询未订购学生
- public function actionSearchNoBuy(){
- $param['schoolYearId']=Req::post('schoolYearId');
- $param['gradeId']=Req::post('grade');
- $param['pageNum']=Req::post('page');
- if(Req::post('semesterId')){
- $param['semesterId']=Req::post('semesterId')-1;
- }
- if(!$param['pageNum']) $param['pageNum']=1;
- $http = http('order/coach/student/not-buy/page', 'post', $this->authUsername,$param);
- $response = formatResponse($http);
- $result['status']=0;
- if($response['status']==1){
- $result['status']=1;
- $result['data']['list']=$response['data']['list'];
- $result['data']['total_page']=$response['data']['pages'];
- $result['data']['now_page']=$param['pageNum'];
- }
- exit(json_encode($result));
- }
- //导出未订购学生
- public function actionExportNoBuyStudent(){
- $param['schoolYearId']=Req::post('schoolYearId');
- $param['gradeId']=Req::post('grade');
- if(Req::post('semesterId')){
- $param['semesterId']=Req::post('semesterId')-1;
- }
- $http = http('order/coach/student/not-buy/export', 'post', $this->authUsername,$param);
- $response = formatResponse($http);
- $result['status']=0;
- if($response['status']==1){
- $result['status']=1;
- $result['data']=$response['data'];
- }else{
- $result['data']=$response['data'];
- }
- exit(json_encode($result));
- }
- //新建商品变更
- public function actionNewGoodsChange(){
- //获取学年
- $http = http('sys/school/year/period/list', 'get', $this->authUsername);
- $response = formatResponse($http);
- $result['schoolYear'] = $response['data'];
- $this->render('newGoodsChange',$result);
- }
- //根据学年查询可用于变更的销售订单
- public function actionCanChangeOrder(){
- $result=array();
- $result['status']=0;
- $schoolYearId=Req::post('schoolYearId');
- if(!$schoolYearId){
- $result['msg']='参数异常';
- exit(json_encode($result));
- }
- $http = http('order/goods/change/coach/purpose-can-change-list', 'post', $this->authUsername,array('schoolYearId'=>$schoolYearId));
- $response = formatResponse($http);
- if($response['status']==1){
- $result['status']=1;
- $result['data']=$response['data'];
- }
- exit(json_encode($result));
- }
- //根据销售订单查询需要变更的财务订单
- public function actionNeedChangeOrder(){
- $result=array();
- $result['status']=0;
- $orderId=Req::post('orderId');
- if(!$orderId){
- $result['msg']='参数异常';
- exit(json_encode($result));
- }
- $http = http('order/goods/change/coach/official-list/'.$orderId, 'get', $this->authUsername);
- $response = formatResponse($http);
- if($response['status']==1){
- $result['status']=1;
- $result['data']=$response['data'];
- }else{
- $result['msg']=$response['data'];
- }
- exit(json_encode($result));
- }
- //查询财务订单的学生列表
- public function actionOrderStudentList(){
- $result=array();
- $result['status']=0;
- $orderId=Req::post('orderId');
- if(!$orderId){
- $result['msg']='参数异常';
- exit(json_encode($result));
- }
- $http = http('order/goods/change/coach/order-students/'.$orderId, 'get', $this->authUsername);
- $response = formatResponse($http);
- if($response['status']==1){
- $result['status']=1;
- $result['data']=$response['data'];
- }
- exit(json_encode($result));
- }
- //查看变更订单详情
- public function actionViewGoodsChange(){
- $ogcId=Req::get('id');
- $page=Req::get('page') ? Req::get('page') : 1;
- if(!$ogcId){
- Yii::app()->jump->error("参数异常");
- }
- $http = http('order/goods/change/coach/'.$ogcId, 'get', $this->authUsername);
- $response = formatResponse($http);
- if($response['status']==1){
- $result=$response['data'];
- }else{
- Yii::app()->jump->error($response['data']);
- }
- //读取订单学生
- $http = http('order/goods/change/coach/'.$ogcId.'/students?pageNum='.$page, 'get', $this->authUsername);
- $response = formatResponse($http);
- $result['page']=$response['data'];
- $result['id']=$ogcId;
- $result['students']=$response['data']['list'];
-
- $this->render('viewGoodsChange',$result);
- }
- //保存商品变更
- public function actionSaveGoodsChange(){
- $ogcId=Req::post('ogcId');
- $oldOrderId=Req::post('oldOrderId');
- $purposeOrderId=Req::post('purposeOrderId');
- $studentIdArr=Req::post('studentList');
- $goodsChange=Req::post('goodsChange');
- $studentIdArr=str_replace('"','"',$studentIdArr);
- @$studentIdArr=json_decode($studentIdArr,true);
- $students = array();
- if(!$studentIdArr){
- returnMsg(0,'学生数据解析失败');
- }
- foreach ($studentIdArr as $k=>$v){
- if(!$v['value']){
- continue;
- }
- $students[]=$v['value'];
- }
- $params['studentIds'] = $students;
- $params['oldOrderId'] = $oldOrderId;
- $params['purposeOrderId'] = $purposeOrderId;
- $params['goodsChange'] = $goodsChange;
- if($ogcId){
- $http = http('order/goods/change/coach/'.$ogcId, 'PUT', $this->authUsername,$params);
- }else{
- $http = http('order/goods/change/coach', 'post', $this->authUsername,$params);
- }
- $response = formatResponse($http);
- if($response['status']==1){
- returnMsg(1,'提交成功');
- }else{
- returnMsg(0,$response['data']);
- }
- }
- //查询用于商品变更的订单
- public function actionSearchGoodsChange(){
- if(Req::get('schoolYearId')){
- $param['schoolYearId']=Req::get('schoolYearId');
- }
- if(Req::get('grade')){
- $param['grade']=Req::get('grade');
- }
- $param['pageNum']= Req::get('page') ? Req::get('page') : 1;
- //获取学年
- $http = http('sys/school/year/period/list', 'get', $this->authUsername);
- $response = formatResponse($http);
- $result['schoolYear'] = $response['data'];
- $http = http('order/goods/change/coach/purpose-page', 'post', $this->authUsername,$param);
- $response = formatResponse($http);
- if($response['status']==1){
- $result['list']=$response['data']['list'];
- $result['page']=$response['data'];
- }else{
- $result['list']=array();
- $result['page']=array();
- }
- //debug($result);
- $this->render('searchGoodsChange',$result);
- }
- //重新提交变更订单(编辑)
- public function actionEditGoodsChange(){
- $ogcId=Req::get('id');
- if(!$ogcId){
- Yii::app()->jump->error("参数异常");
- }
- $http = http('order/goods/change/coach/'.$ogcId, 'get', $this->authUsername);
- $response = formatResponse($http);
- if($response['status']==1){
- $result=$response['data'];
- }else{
- Yii::app()->jump->error($response['data']);
- }
- //获取学年
- $http = http('sys/school/year/period/list', 'get', $this->authUsername);
- $response = formatResponse($http);
- $result['schoolYear'] = $response['data'];
- $result['ogcId']=$ogcId;
- $result['studentIds']=array();
- $this->render('editGoodsChange',$result);
- }
- //商品变更查询可变更人数
- public function actionSearchChangeNum(){
- $orderId=Req::post('orderId');
- $financeOrderId=Req::post('financeOrderId');
- $result['status']=0;
- $http = http('order/goods/change/coach/can-change-num/'.$financeOrderId.'/'.$orderId, 'get', $this->authUsername);
- $response = formatResponse($http);
- if($response['status']==1){
- $result['status']=1;
- $result['data']=$response['data'];
- }else{
- Yii::app()->jump->error($response['data']);
- }
- exit(json_encode($result));
- }
- //服务费查询密码
- public function actionValidationPwd(){
- $password=Req::post('password');
-
- $result['status']=0;
- $http = http('coach-service-charge/coach/validation/'.$password, 'get', $this->authUsername);
-
- $response = formatResponse($http);
-
- if($response['status']==1){
- $result['status']=1;
-
- }else{
- $result['msg']=$response['data'];
- }
- exit(json_encode($result));
- }
- //服务费修改查询密码
- public function actionUpdateServicePwd(){
- $password=Req::post('password');
- $newPassword=Req::post('newPassword');
- $checkPassword=Req::post('checkPassword');
- $result['status']=0;
- if(!$password || !$newPassword || !$checkPassword){
- $result['msg']='密码不能为空';
- exit(json_encode($result));
- }
- if($newPassword!=$checkPassword){
- $result['msg']='两次密码输入不一致';
- exit(json_encode($result));
- }
- $params=array(
- 'oldPassword'=>$password,
- 'newPassword'=>$newPassword,
- 'confirmPassword'=>$checkPassword,
- );
- $http = http('coach-service-charge/coach/update/service-password', 'post', $this->authUsername,$params);
- $response = formatResponse($http);
-
- if($response['status']==1){
- $result['status']=1;
-
- }else{
- $result['msg']=$response['data'];
- }
- exit(json_encode($result));
- }
- //销售订单推送名单
- public function actionPushList(){
- $orderId= Req::get('orderId');
- $clazzId= Req::get('clazzId');
- $isPay= Req::get('isPay');
- $page = Req::get('page') ? Req::get('page') : 1;
- $params=array(
- 'orderId'=>$orderId,
- 'pageNum'=>$page
- );
- if($clazzId){
- $params['clazzId']=$clazzId;
- }
- if($isPay){
- $params['isPay']=intval($isPay-1);
- }
- $res = http('order/coach/push-student/page', 'post', $this->authUsername,$params);
- $response = formatResponse($res);
- if($response['status']==1){
- $result['list']=$response['data']['list'];
- $result['page']=$response['data'];
- }else{
- $result['list']=array();
- $result['page']=array();
- }
- //读取班级
- $res = http('order/coach/push-student/clazz/'.$orderId, 'get', $this->authUsername);
- $response = formatResponse($res);
- if($response['status']==1){
- $result['classList']=$response['data'];
- }
- $this->render('pushList',$result);
- }
- //销售订单推送名单导出
- public function actionPushListExport(){
- $orderId= Req::post('orderId');
- $clazzId= Req::post('clazzId');
- $isPay= Req::post('isPay');
- $params=array(
- 'orderId'=>$orderId,
- );
- if($clazzId){
- $params['clazzId']=$clazzId;
- }
- if($isPay){
- $params['isPay']=intval($isPay-1);
- }
- $res = http('order/coach/push-student/export', 'post', $this->authUsername,$params);
- $response = formatResponse($res);
- if($response){
- echo json_encode($response);exit;
- }else{
- echo json_encode(array("status"=>0,"error"=>"导出失败"));exit;
- }
- }
- //回款反馈申请
- public function actionPaymentApply(){
- $params = array();
- if(Req::get('grade')){
- $params['grade']=Req::get('grade');
- }
- if(Req::get('schoolYearId')){
- $params['schoolYearId']=Req::get('schoolYearId');
- }
- if(Req::get('semester')){
- $params['semester']=Req::get('semester')-1;
- }
- if(Req::get('recordNo')){
- $params['recordNo']=Req::get('recordNo');
- }
- if(Req::get('bcNo')){
- $params['bcNo']=Req::get('bcNo');
- }
- if(Req::get('page')){
- $params['pageNum']=Req::get('page');
- }else{
- $params['pageNum']=1;
- }
- //列表
- $http = http('finance/back/coach/client/record/page', 'post', $this->authUsername, $params);
- $response = formatResponse($http);
- if($response['status']==1){
- $result['list']=$response['data']['list'];
- $result['page'] = $response['data'];
- }else{
- if(isset($response['data']) && $response['data']){
- Yii::app()->jump->error($response['data']);
- }else{
- Yii::app()->jump->error("保存失败");
- }
- }
-
- //获取学年
- $http = http('sys/school/year/period/list', 'get', $this->authUsername);
- $response = formatResponse($http);
- $result['schoolYear'] = $response['data'];
- $goodArr = $this->getGood();
- $result['goodList'] = $goodArr;
- $result['params']=$params;
- $this->render('paymentApplyList',$result);
- }
- //查看回款反馈申请
- public function actionViewPaymentApply(){
- $id=Req::get('id');
- $http = http('finance/back/coach/record/detail/'.$id, 'get', $this->authUsername);
- $response = formatResponse($http);
- if($response['status']==1){
- $result['data']=$response['data'];
- }
- $this->render('viewPaymentApply',$result);
- }
- //编辑回款反馈申请
- public function actionEditPaymentApply(){
- $id=Req::get('id');
- if (Yii::app()->request->getIsPostRequest()){
- $bdId=Req::post('bcId');
- //保存
- $param['orderId']=Req::post('orderId');
- $param['useNum']=Req::post('use_person');
- $param['schoolYearId']=Req::post('schoolYearId');
- if(Req::post('semester')){
- $param['semester']=Req::post('semester')-1;
- }
- $param['grade']=Req::post('grade');
- $param['goodsId']=Req::post('goodsId');
- $param['downloadNum']=Req::post('down_person');
- $param['price']=Req::post('price');
- $param['feeNumUp']=Req::post('feeNumUp');
- $param['priceSumUp']=Req::post('priceSumUp');
- $param['feeNumDown']=Req::post('feeNumDown');
- $param['priceSumDown']=Req::post('priceSumDown');
- $param['feeTime']=date('Y-m-d H:i:s',strtotime(Req::post('charge_time')));
- if(Req::post('pay_time')){
- $param['remitDate']=date('Y-m-d H:i:s',strtotime(Req::post('pay_time')));
- }
- $param['remark']=Req::post('mark');
- $param['bcId']=$bdId;
- $param['recordId']=$id;
- $http = http('finance/back/coach/edit', 'post', $this->authUsername,$param);
- $response = formatResponse($http);
- if($response['status']==1){
- $this->redirect('/imsSale/paymentApply');
- }else{
- if(isset($response['data']) && $response['data']){
- Yii::app()->jump->error($response['data']);
- }else{
- Yii::app()->jump->error("保存失败");
- }
- }
- }
- $http = http('finance/back/coach/client/record/'.$id, 'get', $this->authUsername);
- $response = formatResponse($http);
- if($response['status']==1){
- $result['data']=$response['data'];
- }
- //销售订单列表
- $http = http('order/coach/purpose/list', 'get', $this->authUsername);
- $response = formatResponse($http);
- if($response['status']==1){
- $result['orderList']=$response['data'];
- }
- //获取学年
- $http = http('sys/school/year/period/list', 'get', $this->authUsername);
- $response = formatResponse($http);
- $result['schoolYear'] = $response['data'];
- //debug($http);
- $goodArr = $this->getGood();
- $result['goodList'] = $goodArr;
- $this->render('editPaymentApply',$result);
- }
- //取消回款反馈申请
- public function actionCancelPaymentApply(){
- $id=Req::get('id');
- $http = http('activiti/coach/process-instances/'.$id.'/suspended', 'put', $this->authUsername);
- $response = formatResponse($http);
- if($response['status']==1){
- $this->redirect('/imsSale/paymentApply');
- }else{
- if(isset($response['data']) && $response['data']){
- Yii::app()->jump->error($response['data']);
- }else{
- Yii::app()->jump->error("取消失败");
- }
- }
- }
- //删除回款反馈申请
- public function actionDeletePaymentApply(){
- $id=Req::get('id');
- $http = http('activiti/coach/process-instances/'.$id, 'delete', $this->authUsername);
- $response = formatResponse($http);
- if($response['status']==1){
- $this->redirect('/imsSale/paymentApply');
- }else{
- if(isset($response['data']) && $response['data']){
- Yii::app()->jump->error($response['data']);
- }else{
- Yii::app()->jump->error("删除失败");
- }
- }
- }
- //普通试用时间表
- public function actionTimeTable(){
- $http = http('order/coach/trial-date', 'get', $this->authUsername);
- $response = formatResponse($http);
- $result['status']=0;
- if($response['status']==1){
- $result['status']=1;
- $result['data']=$response['data'];
- }else{
- $result['msg']=$response['data'];
- }
- exit(json_encode($result));
- }
- //试用订单,根据时间查可用学期
- public function actionGetSemesterByBeginTime(){
- $beginTime=Req::post('beginTime');
- $param['beginTime']=date('Y-m-d 00:00:00',strtotime($beginTime));
- $http = http('order/coach/trial/useful-semester', 'post', $this->authUsername,$param);
- $response = formatResponse($http);
- $result['status']=0;
- if($response['status']==1){
- $result['status']=1;
- $result['data']=$response['data'];
- }else{
- $result['msg']=$response['data'];
- }
- exit(json_encode($result));
- }
- //试用订单,获取试用类型
- public function actionGetUsefulType(){
- $beginTime=Req::post('beginTime');
- $goodsTypeId=Req::post('goodsTypeId');
- $grade=Req::post('grade');
- $subject=Req::post('subject');
- $yearSemester=Req::post('yearSemester');
- $param=array();
- $param['beginTime']=date('Y-m-d 00:00:00',strtotime($beginTime));
- $param['goodsTypeId']=$goodsTypeId;
- $param['grade']=$grade;
- $param['subject']=$subject;
- $param['yearSemester']=$yearSemester;
-
- $http = http('order/coach/trial/useful-type', 'post', $this->authUsername,$param);
- $response = formatResponse($http);
- $result['status']=0;
- if($response['status']==1){
- $result['status']=1;
- $result['data']=$response['data'];
- }else{
- $result['msg']=$response['data'];
- }
- exit(json_encode($result));
- }
- //新增、编辑问调表
- public function actionEditExperience(){
- $param['appearanceFineness']=Req::post('appearanceFineness');
- $param['printingEffect']=Req::post('printingEffect');
- $param['scanPaperJam']=Req::post('scanPaperJam');
- $param['printPaperJam']=Req::post('printPaperJam');
- $param['id']=Req::post('id');
- $http = http('storage-allocate/coach/edit-experience', 'post', $this->authUsername,$param);
- $response = formatResponse($http);
- $result['status']=0;
- if($response['status']==1){
- $result['status']=1;
- $result['data']=$response['data'];
- }else{
- $result['msg']=$response['data'];
- }
- exit(json_encode($result));
- }
- /**
- * 产品试用重启列表
- */
- public function actionTrialRestart()
- {
- $params = array();
- $result = array();
- $page = Req::get('page') ? Req::get('page') : 1;
- if (Req::get('goodsTypeId')) {
- $params['goodsTypeId'] = Req::get('goodsTypeId');
- }
- if (Req::get('grade')) {
- $params['grade'] = Req::get('grade');
- }
- if (Req::get('orderNo')) {
- $params['orderNo'] = Req::get('orderNo');
- }
- $params['pageNum']=$page;
- //获取产品
- $goodArr = $this->getGoodType();
- $result['goodList'] = $goodArr;
- $http = http('order-trial-enable/coach/page' , 'POST', $this->authUsername, $params);
- $response = formatResponse($http);
- $data = $response['data'];
- if ($response['status']) {
- $result['page'] = $data;
- $result['list'] = isset($data['list'])?$data['list']:array();
- } else {
- $result['page'] = array();
- $result['list'] = array();
- }
-
- return $this->render('trialTableRestart', $result);
- }
- //查看重启详情
- public function actionViewRestart(){
- $oteId = Req::get('oteId') ? Req::get('oteId') : 0;
- if(!$oteId){
- Yii::app()->jump->error('ID不正确');
- }
- $http = http('order-trial-enable/coach/detail/'.$oteId , 'GET', $this->authUsername);
- $response = formatResponse($http);
- $result=$response['data'];
- //; debug($result);
- return $this->render('trialTableRestartView', $result);
- }
- //试用订单删除学生申请列表
- public function actionTrialDeleteList(){
- $params = array();
- $result = array();
- $page = Req::get('page') ? Req::get('page') : 1;
- if (Req::get('goodsTypeId')) {
- $params['goodsTypeId'] = Req::get('goodsTypeId');
- }
- if (Req::get('grade')) {
- $params['grade'] = Req::get('grade');
- }
- if (Req::get('orderNo')) {
- $params['orderNo'] = Req::get('orderNo');
- }
- $params['pageNum']=$page;
- //获取产品
- $goodArr = $this->getGoodType();
- $result['goodList'] = $goodArr;
- $http = http('order-trial-delete/coach/page' , 'POST', $this->authUsername, $params);
- $response = formatResponse($http);
- $data = $response['data'];
- if ($response['status']) {
- $result['page'] = $data;
- $result['list'] = isset($data['list'])?$data['list']:array();
- } else {
- $result['page'] = array();
- $result['list'] = array();
- }
- return $this->render('trialTableDelete', $result);
- }
- //试用订单删除学生申请详情查看
- public function actionTrialDeleteDetail(){
- $otdId = Req::get('otdId') ? Req::get('otdId') : 0;
- if(!$otdId){
- Yii::app()->jump->error('ID不正确');
- }
- $http = http('order-trial-delete/coach/detail/'.$otdId , 'GET', $this->authUsername);
- $response = formatResponse($http);
- $result=$response['data'];
- //; debug($result);
- return $this->render('trialTableDeleteView', $result);
- }
- //试用订单删除学生选择学生页面
- public function actionTrialDeleteApply(){
- $orderId = Req::get('orderId') ? Req::get('orderId') : 0;
- $result=array();
- //判断是否能发起申请
- $http = http('order-trial-delete/coach/can-apply/'.$orderId , 'GET', $this->authUsername);
- $response = formatResponse($http);
- if(!$response['status']){
- Yii::app()->jump->error($response['data']);
- }
- $result['orderId']=$orderId;
- return $this->render('trialTableDeleteApply', $result);
- }
- //新增试用订单删除学生申请
- public function actionOrderTrialDelete(){
- $orderId = Req::post('orderId') ? Req::post('orderId') : 0;
- $reason = Req::post('reason') ? Req::post('reason') :'';
- $osIds = Req::post('osIds') ? Req::post('osIds') : array();
- $result=array();
- $result['status']=0;
- if(!$orderId){
- $result['msg']="订单id不能为空";
- exit(json_encode($result));
- }
- if(!$reason){
- $result['msg']="删除原因不能为空";
- exit(json_encode($result));
- }
- if(!$osIds){
- $result['msg']="学生不能为空";
- exit(json_encode($result));
- }
- $params=array();
- $params['osIds']=$osIds;
- $params['reason']=$reason;
- $params['otId']=$orderId;
- //判断是否能发起申请
- $http = http('order-trial-delete/coach' , 'POST', $this->authUsername,$params);
- $response = formatResponse($http);
- if($response['status']==1){
- $result['status']=1;
- $result['data']=$response['data'];
- }else{
- $result['msg']=$response['data'];
- }
- exit(json_encode($result));
- }
- //请求暂停、开启班级列表
- public function actionGetDeleteClassesByOrderId(){
- $orderId=Req::post('orderId');
- $result['status']=0;
- //读取班级列表
- $http = http('order-trial-delete/coach/clazz-list/'.$orderId, 'get', $this->authUsername);
- $responseArr = formatResponse($http);
- if($responseArr['status']==1){
- $result=$responseArr;
- $result['students']=array();
- //读取学生列表
- if($result['data']){
- $classId=$result['data'][0]['clazzId'];
- $studentHttp= http('order-trial-delete/coach/student-list/'.$orderId.'/'.$classId, 'get', $this->authUsername);
- $students=formatResponse($studentHttp);
- if($students['status']==1){
- $result['students']=$students['data'];
- }
- }
- }
- exit(json_encode($result));
- }
- //读取删除学生列表
- public function actionGetDeleteStudentByClassIdOrderId(){
- $orderId=Req::post('orderId');
- $classId=Req::post('classId');
- $result['status']=0;
- $studentHttp= http('order-trial-delete/coach/student-list/'.$orderId.'/'.$classId, 'get', $this->authUsername);
- $students=formatResponse($studentHttp);
- if($students['status']==1){
- $result['status']=1;
- $result['data']=$students['data'];
- }
- exit(json_encode($result));
- }
- //服务费确认/提交异议
- public function actionConfirmServiceCharge(){
- $batchId=Req::post('batchId');
- $verify=Req::post('verify');
- $problem=Req::post('problem');
- $result['status']=0;
- if(!$batchId){
- $result['data']='参数异常';
- exit(json_encode($result));
- }
- if(!$verify) $verify=1;
- $params=array();
- $params['batchId']=$batchId;
- $params['verify']=$verify;
- if($problem){
- $params['problem']=$problem;
- }
- $http = http('coach-service-charge/coach/archive/update-status', 'PUT', $this->authUsername,$params);
- $response = formatResponse($http);
- if($response['status']==1){
- $result['status']=1;
- }else{
- $result['data']=$response['data'];
- }
- exit(json_encode($result));
- }
- }
|