column=$column;
Doo::loadModel('Article');
$article=new Article();
$cid=$this->column['COMPANY'];
$this->comart=$article->getArticleByCid($cid,4);
}
function index() {
Doo::loadModel('Column');
Doo::loadModel('Product');
$article=new Article();
$product=new Product();
$column=new Column();
$cid=$this->column['SOFTAPP'].",".$this->column['WEBAPP'];
$data['WEBAPP']=$this->column['WEBAPP'];
$col=$column->getColumnByIdList($cid);
//foreach ($col as $key=>$value){
$pro=$product->getProductByCid($col[0]['cid']);
$col[0]['product']=$pro;
//}
$cid=$this->column['TRAINC'];
$train=$article->getArticleByTrain(2);
$end=$doing=$apply=array();
foreach ($train as $key=>$value){
$type=getTrainTimeByStatus($value['enroll_time']);
$date=explode(":", $value['enroll_time']);
if($type=="end"){
$train[$key]['timeStuts']="
结束 ".$date[1]."
";
array_push($end, $train[$key]);
}elseif ($type=="doing"){
$train[$key]['timeStuts']="进行中";
array_push($doing, $train[$key]);
}elseif ($type=="apply"){
$time = strtotime($date[0]) - 60*60*24;
$train[$key]['timeStuts']="报名中截止".date('Y-m-d',$time)."
";
array_push($apply, $train[$key]);
}
}
$ta=$apply+$doing+$end;
//print_r($ta);die;
//$type=="apply";
//$article->find ( array ('desc' => 'time', 'limit'=>4 , 'where' => 'cid=4 and ', 'asArray' => TRUE ) );
//$art=$article->getArticleByCid($cid,4);
$art=array_slice($ta,0,4);
foreach ($art as $key=>$value){
$art[$key]['timeStuts']=getTrainTime2($value['enroll_time']);
$art[$key]['timeStuts3']=getTrainTime3($value['enroll_time']);
$art[$key]['Stuts']=strlen($art[$key]['timeStuts']);
}
$list1=$article->getArticleByCid2($this->column['COMPANY'],5);
foreach ($list1 as $key=>$value){
$list1[$key]['title']=$this->cut_str($value['title'], 45);
}
$list2=$article->getArticleByCid($this->column['INDUSTRY'],5);
foreach ($list2 as $key=>$value){
$list2[$key]['title']=$this->cut_str($value['title'], 45);
}
Doo::loadModel('Product');
$product=new Product();
$data['product']=$product->getProductByCidAll($this->column['SOFTAPP']);
$data['article']=$art;
$data['comart']=$this->comart;
$data['column']=$col;
$data['map']='index';
$data['companyNews']=$list1;
$data['industryNews']=$list2;
$this->render ( "/index3", $data );
}
function softDown2(){
Doo::loadModel('Product');
Doo::loadModel('Down');
$down=new Down();
$product=new Product();
$data['product']=$product->getProductByCidAll($this->column['SOFTAPP']);
$html="";
foreach ($data['product'] as $key=>$value){
$data['product'][$key]['down']=array();
if(!empty($value['did']))
$data['product'][$key]['down']=$down->getDownByIdList($value['did']);
foreach ($data['product'][$key]['down'] as $keys=>$values){
$t=explode("{b}", $values['down_url']);
$i=2;
foreach ($t as $k=>$v){
if($i==2)
$html.='点击下载';
// elseif($i==1)
// $html.='联通线路';
$i--;
}
$data['product'][$key]['down'][$keys]['html']=$html;
$i=2;$html="";
}
}
$data['comart']=$this->comart;
$data['map']='softDown';
$this->render ( "/softDown2", $data );
}
function softDown(){
Doo::loadModel('Product');
$product=new Product();
$data['product']=$product->getProductByCidAll($this->column['SOFTAPP']);
$data['comart']=$this->comart;
$data['map']='softDown';
$this->render ( "/softDown", $data );
}
function ajaxSoftDown(){
Doo::loadModel('Down');
Doo::loadModel('Product');
Doo::loadModel('Animation');
$animation=new Animation();
$product=new Product();
$down=new Down();
$did=$this->get_args('did');
$pid=$this->get_args('pid');
if(!empty($did))
$do['dot']=$down->getDownByIdList($did);
$info=$product->getProductById($pid);
$MyAnimation=array();
if(!empty($info[0]['anid']))
$MyAnimation=$animation->getAnimationByIdList($info[0]['anid']);
$belongAnimation=$animation->getAnimationByBelong();
$uc='
';
if (empty($MyAnimation) ){
$uc.='
该软件无专属教程,您可观看通用教程';
}else{
$uc.='
专属教程
';
foreach ($MyAnimation as $key=>$value){
$uc.='-
'.$value['title'].'
';
}
$uc.='
';
}
$uc.='
通用教程
';
foreach ($belongAnimation as $key=>$value){
$uc.='-
'.$value['title'].'
';
}
$uc.='
';
$html='
'.$info[0]['title'].'
'.$info[0]['edition'].'
'.$info[0]['content'].'
'.$uc.'
';
if($info[0]['p_type']!=2)
$do['info']=$html;
else
$do['info']="";
$show=json_encode($do);
echo $show;
}
function product(){
$pid=$this->params['pid'];
$tab = $this->get_args ( 'tab' ) ? $this->get_args ( 'tab' ) : 'down';
$pid=is_numeric($pid)?$pid:0;
Doo::loadModel('Product');
Doo::loadModel('Down');
Doo::loadModel('DownVersion');
$down=new Down();
$product=new Product();
$downversion=new DownVersion();
Doo::loadModel('Animation');
$animation=new Animation();
Doo::loadModel( 'Course' );
$course = new Course();
$data['product']=$product->getProductByCid($this->column['SOFTAPP']);
if (empty($pid))
$pid=$data['product'][0]['pid'];
//获取下载内容
$data['productInfo']=$product->getProductById($pid);
if(isset($data['productInfo'][0]['isstartup']) && $data['productInfo'][0]['isstartup'] == 1) {
Doo::loadModel('Startup');
$startup = new Startup();
$data['down_url'] = $startup->getDownUrlById();
}
if(empty($data['productInfo'][0]['did']))
$data['productInfo'][0]['did']=0;
$do=$down->getDownByIdList($data['productInfo'][0]['did']);
foreach ($do as $key=>$value){
$url=explode("{b}", $value['down_url']);
$do[$key]['down_url']=$url;
$down_version_msg = $downversion->getVersionByDidAnd2($value['did']);
$do[$key]['version_msg'] = !empty($down_version_msg) ? $down_version_msg['version_msg'] : '';
}
$data['productInfo'][0]['down']=$do;
//获得教程
$courseList=$course->getCourseAllLikePid($pid);
$data['courseList']=$courseList;
// $data['MyAnimation']=array();
// if(!empty($data['productInfo'][0]['anid']))
// $data['MyAnimation']=$animation->getAnimationByIdList($data['productInfo'][0]['anid']);
//
// $data['belongAnimation']=$animation->getAnimationByBelong();
$data['tab']=$tab;
$data['comart']=$this->comart;
$data['map']='product';
$data['title']=$data['productInfo'][0]['title'];
$this->render ( "/product", $data );
}
/*
*教程
*/
function course(){
$idKey=isset($this->params ['idKey'])?$this->params['idKey']:'';
$p = $this->get_args ( 'p' ) && is_numeric ( $this->get_args ( 'p' ) ) ? $this->get_args ( 'p' ) : '';
Doo::loadClass ( 'XDeode' );
$XDeode = new XDeode ( 5 );
$id = $XDeode->decode ( $idKey );
if (! is_numeric ( $id ))
die ( 'illegal request' );
Doo::loadModel( 'Course' );
$course = new Course();
Doo::loadModel('Animation');
$animation=new Animation();
$courseDetail=$course->getCourseById($id);
$courseDetail['videoHtml']='';
foreach ($courseDetail['animationList'] as $key=>$value){
/* preg_match_all("/