home.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. class home_c extends Control
  3. {
  4. function __construct()
  5. {
  6. parent::Control();
  7. $this->load_model("user");
  8. $this->load_model("msg");
  9. $this->load_model("customer");
  10. }
  11. function home_c()
  12. {
  13. $this->__construct();
  14. }
  15. function index_f()
  16. {
  17. $myRecommendUID=$this->trans_lib->safe("ruid");
  18. if(!$myRecommendUID)
  19. {
  20. $myRecommendUID=0;
  21. }else if($myRecommendUID>0){
  22. $_SESSION["Recommend_UID"]=$myRecommendUID;
  23. }
  24. /*print_r(strlen("中").$this->sys_config[CommissionPercentage1] );
  25. if($this->STCModel->Appid){
  26. print_r("SysTemSiteConfig".$this->STCModel->Appid);
  27. }else{
  28. print_r("on");
  29. }*/
  30. if($_SESSION["user_id"]){
  31. $urs = $this->user_m->user_from_id($_SESSION["user_id"]);
  32. if($urs){
  33. if($_SESSION["oauthuser_info"])
  34. {
  35. $urs["picture"]=$_SESSION["oauthuser_info"]->headimgurl;
  36. }
  37. $this->tpl->assign("urs",$urs);
  38. }
  39. }
  40. $rslist = $this->user_m->get_toplist();
  41. $this->tpl->assign("rslist",$rslist);
  42. $rs = $this->msg_m->get_one(3);
  43. $id = $rs["id"];
  44. $this->tpl->assign("id",$id);
  45. $this->tpl->assign("rs",$rs);
  46. $this->tpl->display("home.".$this->tpl->ext);
  47. //$myRecommendName="";
  48. //print_r($_SESSION["Recommend_UID"]);
  49. }
  50. function updategroup_f()
  51. {
  52. if(!$_SESSION["user_id"])
  53. {
  54. echo "分享成功";
  55. exit;
  56. }else{
  57. $uid = $_SESSION["user_id"];
  58. $this->user_m->update_group($uid);
  59. echo "分享成功,你已经升级为金牌合伙人";
  60. exit;
  61. }
  62. }
  63. }
  64. ?>