123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687 |
- <?php
- /*****初始路由*************/
- namespace app\common\components;
- use Yii;
- use yii\helpers\Url;
- class SiteUrl {
- //首页
- public static function home($share_no='')
- {
- if(!empty($share_no))
- {
- return Url::to(['/web/default/index',Yii::$app->params['shareArgName']=>$share_no],true);
- }
- else
- {
- return Url::to(['/web/default/index'],true);
- }
- }
- //栏目展示
- public static function catlist()
- {
- return Url::to(['/web/default/catlist'],true);
- }
- //用户中心首页
- public static function ucenter()
- {
- $url = Url::to(['/ucenter/default/index'],true);
- return $url;
- }
- public static function loginhome($refer_page='')
- {
- if(!empty($refer_page))
- {
- $url = Url::to(['/ucenter/default/loginhome',Yii::$app->params['referPageName']=>$refer_page],true);
- }
- else
- {
- return Url::to(['/ucenter/default/loginhome'],true);
- }
- return $url;
- }
- public static function login($refer_page='')
- {
- if(!empty($refer_page))
- {
- $url = Url::to(['/ucenter/default/login',Yii::$app->params['referPageName']=>$refer_page],true);
- }
- else
- {
- $url = Url::to(['/ucenter/default/login'],true);
- }
- return $url;
- }
- public static function logout()
- {
- return Url::to(['/ucenter/default/logout'],true);
- }
- public static function register()
- {
- return Url::to(['/ucenter/default/register'],true);
- }
- public static function forgetpwd()
- {
- return Url::to(['/ucenter/default/forgetpwd'],true);
- }
- //账号设置
- public static function myaccount($tab=null)
- {
- if(empty($tab))
- {
- return Url::to(['/ucenter/default/account'],true);
- }
- else
- {
- return Url::to(['/ucenter/default/account','tab'=>$tab],true);
- }
- }
- //实名认证
- public static function certindex()
- {
- return Url::to(['/ucenter/default/certindex'],true);
- }
- //个人认证
- public static function certuser()
- {
- return Url::to(['/ucenter/default/certuser'],true);
- }
- //企业认证
- public static function certorg()
- {
- return Url::to(['/ucenter/default/certorg'],true);
- }
- //充值金币
- public static function coincharge($refer_page='')
- {
- if(!empty($refer_page))
- {
- $url = Url::to(['/ucenter/default/coincharge',Yii::$app->params['referPageName']=>$refer_page],true);
- }
- else
- {
- $url = Url::to(['/ucenter/default/coincharge'],true);
- }
- return $url;
- }
- //金币日志
- public static function coinlog($type=1)
- {
- $url = Url::to(['/ucenter/default/coinlog','type'=>$type],true);
- return $url;
- }
- //现金日志
- public static function moneylog()
- {
- $url = Url::to(['/ucenter/default/moneylog'],true);
- return $url;
- }
- //积分日志
- public static function pointlog()
- {
- $url = Url::to(['/ucenter/default/pointlog'],true);
- return $url;
- }
- //我的下载
- public static function docpaylog()
- {
- $url = Url::to(['/ucenter/default/docpaylog'],true);
- return $url;
- }
- //我的收藏
- public static function myfavorite()
- {
- $url = Url::to(['/ucenter/default/myfavorite'],true);
- return $url;
- }
- //我的关注
- public static function myfocus()
- {
- $url = Url::to(['/ucenter/default/myfocus'],true);
- return $url;
- }
- //我的足迹
- public static function myhistory()
- {
- $url = Url::to(['/ucenter/default/myhistory'],true);
- return $url;
- }
- //我的订单
- public static function myorder($status=null)
- {
- if($status!=null)
- {
- $url = Url::to(['/ucenter/default/myorder','status'=>$status],true);
- }
- else
- {
- $url = Url::to(['/ucenter/default/myorder'],true);
- }
- return $url;
- }
- //收货地址
- public static function myaddress()
- {
- $url = Url::to(['/ucenter/default/myaddress'],true);
- return $url;
- }
- //我的邀请注册
- public static function myinvite($tab=1)
- {
- if($tab!=null)
- {
- $url = Url::to(['/ucenter/default/myinvite','tab'=>$tab],true);
- }
- else
- {
- $url = Url::to(['/ucenter/default/myinvite'],true);
- }
- return $url;
- }
- //我的消息
- public static function mymsg($type=1)
- {
- $url = Url::to(['/ucenter/default/mymsg','type'=>$type],true);
- return $url;
- }
- //提现账户
- public static function setbank($type=1)
- {
- $url = Url::to(['/ucenter/default/setbank','type'=>$type],true);
- return $url;
- }
- //余额提现
- public static function withdraw($tab=1)
- {
- $url = Url::to(['/ucenter/default/withdraw','tab'=>$tab],true);
- return $url;
- }
- //联系我们
- public static function contact()
- {
- $url = Url::to(['/ucenter/default/contact'],true);
- return $url;
- }
- //我的钱包
- public static function wallet()
- {
- $url = Url::to(['/ucenter/default/wallet'],true);
- return $url;
- }
- //上传文档
- public static function upload()
- {
- $url = Url::to(['/ucenter/uploader/single'],true);
- return $url;
- }
- //上传合辑
- public static function uploadcol()
- {
- $url = Url::to(['/ucenter/uploader/collect'],true);
- return $url;
- }
- //批量上传
- public static function multiupload()
- {
- $url = Url::to(['/ucenter/uploader/multi'],true);
- return $url;
- }
- //发布资源
- public static function uploadsource()
- {
- $url = Url::to(['/ucenter/uploader/source'],true);
- return $url;
- }
- //开通VIP
- public static function vip($refer_page='')
- {
- if(!empty($refer_page))
- {
- $url = Url::to(['/web/default/vip',Yii::$app->params['referPageName']=>$refer_page],true);
- }
- else
- {
- $url = Url::to(['/web/default/vip'],true);
- }
- return $url;
- }
- //生成关注公众号二维码(PC右侧浮动)
- public static function mpSubCode()
- {
- $url = Url::to(['/openauth/mpsub'],true);
- return $url;
- }
- //公众号授权登录(h5)
- public static function mpLogin($scene_id=NULL,$redirect=0,$uauth=null)
- {
- $bd_vid = \app\common\helpers\Cookie::getCookie('bd_vid');
- if($redirect>0)
- {
- if(!empty($uauth))
- {
- if(!empty($bd_vid))
- {
- $url = Url::to(['/ucenter/default/mplogin','scene_id'=>$scene_id,'redirect'=>$redirect,'uauth'=>$uauth,'bd_vid'=>$bd_vid],true);
- }
- else
- {
- $url = Url::to(['/ucenter/default/mplogin','scene_id'=>$scene_id,'redirect'=>$redirect,'uauth'=>$uauth],true);
- }
- }
- else
- {
- if(!empty($bd_vid))
- {
- $url = Url::to(['/ucenter/default/mplogin', 'scene_id' => $scene_id, 'redirect' => $redirect,'bd_vid'=>$bd_vid], true);
- }
- else
- {
- $url = Url::to(['/ucenter/default/mplogin', 'scene_id' => $scene_id, 'redirect' => $redirect], true);
- }
- }
- }
- else
- {
- if(!empty($uauth))
- {
- if(!empty($bd_vid))
- {
- $url = Url::to(['/ucenter/default/mplogin','scene_id'=>$scene_id,'uauth'=>$uauth,'bd_vid'=>$bd_vid],true);
- }
- else
- {
- $url = Url::to(['/ucenter/default/mplogin','scene_id'=>$scene_id,'uauth'=>$uauth],true);
- }
- }
- else
- {
- if(!empty($bd_vid))
- {
- $url = Url::to(['/ucenter/default/mplogin', 'scene_id' => $scene_id,'bd_vid'=>$bd_vid], true);
- }
- else
- {
- $url = Url::to(['/ucenter/default/mplogin', 'scene_id' => $scene_id], true);
- }
- }
- }
- return $url;
- }
- //绑定公众号(h5)
- public static function bindmp($hash=NULL)
- {
- $url = Url::to(['/ucenter/default/bindmp',Yii::$app->params['authHashName']=>$hash],true);
- return $url;
- }
- //搜索中转
- public static function searchSwitch()
- {
- return Url::to(['/web/default/searchswitch'],true);
- }
- //搜索
- public static function search($model_id,$keywords='')
- {
- return Url::to(['/web/default/search', 'model_id' => $model_id,'kw'=>urlencode($keywords)],true);
- }
- //搜索
- public static function searchForWeixin($model_id,$keywords='')
- {
- return Url::to(['/web/default/search', 'model_id' => $model_id,'kw'=>$keywords],true);
- }
- //文档列表
- public static function docList($cat_id=null)
- {
- if(empty($cat_id))
- {
- $url = Url::to(['/doc/default/list'],true);
- }
- else
- {
- $url = Url::to(['/doc/default/list'],true);
- $url = MultiSearchUrl::getSelfInstance(array('url'=>$url,'conditions'=>array('c'=>$cat_id),'filterAll'=>true))->createSearchCondition();
- }
- return $url;
- }
- //文档详情
- public static function docDetail($id,$order_sn='')
- {
- if(!empty($order_sn))
- {
- $url = Url::to(['/doc/default/detail','id'=>$id,'order_sn'=>$order_sn],true);
- }
- else
- {
- $url = Url::to(['/doc/default/detail','id'=>$id],true);
- }
- return $url;
- }
- //合辑列表
- public static function colList($cat_id=null)
- {
- if(empty($cat_id))
- {
- $url = Url::to(['/doc/default/collist'],true);
- }
- else
- {
- $url = Url::to(['/doc/default/collist'],true);
- $url = MultiSearchUrl::getSelfInstance(array('url'=>$url,'conditions'=>array('c'=>$cat_id),'filterAll'=>true))->createSearchCondition();
- }
- return $url;
- }
- //合辑详情
- public static function colDetail($id,$order_sn='')
- {
- if(!empty($order_sn))
- {
- $url = Url::to(['/doc/default/coldetail','id'=>$id,'order_sn'=>$order_sn],true);
- }
- else
- {
- $url = Url::to(['/doc/default/coldetail','id'=>$id],true);
- }
- return $url;
- }
- //个人主页
- public static function uHome($user_id)
- {
- $url = Url::to(['/web/default/uhome','user_id'=>$user_id],true);
- return $url;
- }
- //tag链接
- public static function tagLink($pinyin,$model_id=null)
- {
- if($model_id)
- {
- $url = Url::to(['/web/default/tag', 'model_id' => $model_id,'pinyin'=>$pinyin],true);
- }
- else
- {
- $url = Url::to(['/web/default/tag','pinyin'=>$pinyin],true);
- }
- return $url;
- }
- //资讯首页
- public static function newsHome()
- {
- $url = Url::to(['/cms/news/home'],true);
- return $url;
- }
- //资讯列表
- public static function newsList($cat_id=null)
- {
- if(empty($cat_id))
- {
- $url = Url::to(['/cms/news/list'],true);
- }
- else
- {
- $url = Url::to(['/cms/news/list'],true);
- $url = MultiSearchUrl::getSelfInstance(array('url'=>$url,'conditions'=>array('c'=>$cat_id),'filterAll'=>true))->createSearchCondition();
- }
- return $url;
- }
- //资讯详情
- public static function newsDetail($id)
- {
- $url = Url::to(['/cms/news/detail','id'=>$id],true);
- return $url;
- }
- //生成带下载码的链接(用于微信回复消息)
- public static function downByLink($downcode,$direct=0)
- {
- if(!empty($direct))
- {
- $downurl = Url::to(['/ajax/downdoc','downcode'=>$downcode,'direct'=>$direct],true);
- }
- else
- {
- $downurl = Url::to(['/ajax/downdoc','downcode'=>$downcode],true);
- }
- $url = Url::to(['/web/default/linkdown','downurl'=>base64_encode($downurl)],true);
- return $url;
- }
- //生成文档下载链接
- public static function docDownByCode($downcode,$direct=0)
- {
- if(!empty($direct))
- {
- $downurl = Url::to(['/ajax/downdoc','downcode'=>$downcode,'direct'=>$direct],true);
- }
- else
- {
- $downurl = Url::to(['/ajax/downdoc','downcode'=>$downcode],true);
- }
- return $downurl;
- }
- //单页
- public static function page($cat_id=0)
- {
- if($cat_id>0)
- {
- $url = Url::to(['/web/default/page','cat_id'=>$cat_id],true);
- }
- else
- {
- $url = Url::to(['/web/default/page'],true);
- }
- return $url;
- }
- //公告详情
- public static function announce($id=0)
- {
- if($id>0)
- {
- $url = Url::to(['/web/default/announce','id'=>$id],true);
- }
- else
- {
- $url = Url::to(['/web/default/announce'],true);
- }
- return $url;
- }
- //创作首页
- public static function writerindex()
- {
- $url = Url::to(['/ucenter/writer/index'],true);
- return $url;
- }
- //我的上传
- public static function myupload()
- {
- return Url::to(['/ucenter/writer/myupload'],true);
- }
- //管理文档
- public static function mydoc()
- {
- return Url::to(['/ucenter/writer/mydoc'],true);
- }
- //我的出售
- public static function mysales()
- {
- return Url::to(['/ucenter/writer/mysales'],true);
- }
- /*********************分销中心**********************/
- public static function mycommission()
- {
- return Url::to(['/ucenter/commission/index'],true);
- }
- public static function commissionteam($level=1)
- {
- return Url::to(['/ucenter/commission/team','level'=>$level],true);
- }
- public static function commissionorders()
- {
- return Url::to(['/ucenter/commission/orders'],true);
- }
- public static function commissionlogs($type=1)
- {
- $url = Url::to(['/ucenter/commission/logs','type'=>$type],true);
- return $url;
- }
- /******************下面是只用在手机端****************/
- public static function myinfo()
- {
- return Url::to(['/ucenter/default/myinfo'],true);
- }
- public static function changepwd()
- {
- return Url::to(['/ucenter/default/changepwd'],true);
- }
- public static function bindaccount()
- {
- return Url::to(['/ucenter/default/bindaccount'],true);
- }
- //绑定微信登录
- public static function tobindmp($scene_id)
- {
- $url = Url::to(['/ucenter/default/tobindmp','scene_id'=>$scene_id],true);
- return $url;
- }
- //绑定微信消息
- public static function bindmpmsg($scene_id)
- {
- $url = Url::to(['/ucenter/default/bindmpmsg','scene_id'=>$scene_id],true);
- return $url;
- }
- //绑定手机号
- public static function bindmob()
- {
- return Url::to(['/ucenter/default/bindmob'],true);
- }
- //绑定邮箱
- public static function bindemail($refer_page = '')
- {
- if(!empty($refer_page))
- {
- $url = Url::to(['/ucenter/default/bindemail',Yii::$app->params['referPageName']=>$refer_page],true);
- }
- else
- {
- $url = Url::to(['/ucenter/default/bindemail'],true);
- }
- return $url;
- }
- //收益中心
- public static function income()
- {
- return Url::to(['/ucenter/default/income'],true);
- }
- //积分兑换金币
- public static function point2coin()
- {
- return Url::to(['/ucenter/default/point2coin'],true);
- }
- //金币兑换现金
- public static function coin2money()
- {
- return Url::to(['/ucenter/default/coin2money'],true);
- }
- //问题帮助
- public static function help()
- {
- return Url::to(['/ucenter/default/help'],true);
- }
- //举报
- public static function report($table_name,$data_id)
- {
- $url = Url::to(['/ucenter/default/report','table_name'=>$table_name,'data_id'=>$data_id],true);
- return $url;
- }
- }
|