dever 7 роки тому
батько
коміт
7204795107

+ 3 - 0
config/base.php

@@ -8,6 +8,9 @@ $config['base'] = array
 	# 版本配置
 	'version' => '1.0.0 Beta',
 
+	# 分销级数
+	'level' => 1,
+
 	'apiConfig' => true,
 	'apiSignature' => 'db',
 

+ 1 - 1
main/assets/mobile/404.html

@@ -8,7 +8,7 @@
     <title></title>
 <link href="./css/global.css?v=95681a6c" rel="stylesheet"><link href="./css/404.css?v=95681a6c" rel="stylesheet"></head>
 
-<body ontouchmove="event.preventDefault();">
+<body>
 	<header>
         <a href="#" class="back"></a>
         <span>登录</span>

+ 1 - 1
main/assets/mobile/ad.html

@@ -8,7 +8,7 @@
     <title></title>
 <link href="./css/global.css?v=95681a6c" rel="stylesheet"><link href="./css/ad.css?v=95681a6c" rel="stylesheet"></head>
 
-<body ontouchmove="event.preventDefault();">
+<body>
     <header>
         <a href="#" class="back"></a>
         <span>我的小队</span>

+ 1 - 1
main/assets/mobile/certify-result.html

@@ -8,7 +8,7 @@
     <title></title>
 <link href="./css/global.css?v=95681a6c" rel="stylesheet"><link href="./css/certify-result.css?v=95681a6c" rel="stylesheet"></head>
 
-<body ontouchmove="event.preventDefault();">
+<body>
     <header>
         <a href="#" class="back"></a>
         <span>资料认证</span>

+ 1 - 1
main/assets/mobile/certify.html

@@ -8,7 +8,7 @@
     <title></title>
 <link href="./css/global.css?v=95681a6c" rel="stylesheet"><link href="./css/certify.css?v=95681a6c" rel="stylesheet"></head>
 
-<body ontouchmove="event.preventDefault();">
+<body>
     <header>
         <a href="#" class="back"></a>
         <span>资料认证</span>

+ 1 - 1
main/assets/mobile/cions.html

@@ -8,7 +8,7 @@
     <title></title>
 <link href="./css/global.css?v=95681a6c" rel="stylesheet"><link href="./css/cions.css?v=95681a6c" rel="stylesheet"></head>
 
-<body ontouchmove="event.preventDefault();">
+<body>
     <header>
         <span>我的账户</span>
     </header>

+ 1 - 1
main/assets/mobile/help-article.html

@@ -8,7 +8,7 @@
     <title></title>
 <link href="./css/global.css?v=95681a6c" rel="stylesheet"><link href="./css/help-article.css?v=95681a6c" rel="stylesheet"></head>
 
-<body ontouchmove="event.preventDefault();">
+<body>
     <header>
             <a href="#" class="back"></a>
         <span>帮助中心</span>

+ 1 - 1
main/assets/mobile/help.html

@@ -8,7 +8,7 @@
     <title></title>
 <link href="./css/global.css?v=95681a6c" rel="stylesheet"></head>
 
-<body ontouchmove="event.preventDefault();">
+<body
     <header>
         <span>帮助中心</span>
     </header>

+ 1 - 1
main/assets/mobile/index.html

@@ -8,7 +8,7 @@
     <title></title>
 <link href="./css/global.css?v=95681a6c" rel="stylesheet"><link href="./css/index.css?v=95681a6c" rel="stylesheet"></head>
 
-<body ontouchmove="event.preventDefault();">
+<body>
     <section class="launch">
         <img src="images/34e9dcf9.launch.jpg" width="100%" alt="">
     </section>

+ 9 - 0
main/assets/mobile/js/config.js

@@ -22,6 +22,15 @@ function updateUser(url)
 	$.get(Dever.Host('task', 'user.set?json=1'), send);
 }
 
+$(function(){
+	$("#username").keydown(function(event){
+		if(event.which == 13) {
+			updateUser();
+		}
+	});
+})
+
+
 //定义瀑布流
 Dever.Page().name = '#page';
 Dever.Page().loading = '.loadding';

+ 1 - 1
main/assets/mobile/login.html

@@ -8,7 +8,7 @@
     <title></title>
 <link href="./css/global.css?v=95681a6c" rel="stylesheet"><link href="./css/login.css?v=95681a6c" rel="stylesheet"></head>
 
-<body ontouchmove="event.preventDefault();">
+<body>
 	<header>
         <a href="#" class="back"></a>
         <span>登录</span>

+ 1 - 1
main/assets/mobile/material.html

@@ -8,7 +8,7 @@
     <title></title>
 <link href="./css/global.css?v=95681a6c" rel="stylesheet"></head>
 
-<body ontouchmove="event.preventDefault();">
+<body>
 	<header>
         <a href="#" class="back"></a>
         <span>登录</span>

+ 1 - 1
main/assets/mobile/msgs.html

@@ -8,7 +8,7 @@
     <title></title>
 <link href="./css/global.css?v=95681a6c" rel="stylesheet"><link href="./css/msgs.css?v=95681a6c" rel="stylesheet"></head>
 
-<body ontouchmove="event.preventDefault();">
+<body>
     <header>
         <span>我的消息</span>
     </header>

+ 1 - 1
main/assets/mobile/myaccount.html

@@ -8,7 +8,7 @@
     <title></title>
 <link href="./css/global.css?v=95681a6c" rel="stylesheet"><link href="./css/myaccount.css?v=95681a6c" rel="stylesheet"></head>
 
-<body ontouchmove="event.preventDefault();">
+<body>
     <header>
         <span>我的账户</span>
     </header>

+ 1 - 1
main/assets/mobile/mytask.html

@@ -8,7 +8,7 @@
     <title></title>
 <link href="./css/global.css?v=95681a6c" rel="stylesheet"><link href="./css/mytask.css?v=95681a6c" rel="stylesheet"></head>
 
-<body ontouchmove="event.preventDefault();">
+<body>
     <header>
         <span>我的任务</span>
     </header>

+ 1 - 1
main/assets/mobile/password.html

@@ -8,7 +8,7 @@
     <title></title>
 <link href="./css/global.css?v=95681a6c" rel="stylesheet"><link href="./css/password.css?v=95681a6c" rel="stylesheet"></head>
 
-<body ontouchmove="event.preventDefault();">
+<body>
 	<header>
         <a href="#" class="back"></a>
         <span>登录</span>

+ 1 - 1
main/assets/mobile/recharge.html

@@ -8,7 +8,7 @@
     <title></title>
 <link href="./css/global.css?v=95681a6c" rel="stylesheet"><link href="./css/recharge.css?v=95681a6c" rel="stylesheet"></head>
 
-<body ontouchmove="event.preventDefault();">
+<body>
     <header>
         <a href="#" class="back"></a>
         <span>金币兑换</span>

+ 1 - 1
main/assets/mobile/register.html

@@ -8,7 +8,7 @@
     <title></title>
 <link href="./css/global.css?v=95681a6c" rel="stylesheet"><link href="./css/register.css?v=95681a6c" rel="stylesheet"></head>
 
-<body ontouchmove="event.preventDefault();">
+<body>
 	<header>
         <a href="#" class="back"></a>
         <span>注册</span>

+ 1 - 1
main/assets/mobile/reportlist.html

@@ -8,7 +8,7 @@
     <title></title>
 <link href="./css/global.css?v=95681a6c" rel="stylesheet"><link href="./css/reportlist.css?v=95681a6c" rel="stylesheet"></head>
 
-<body ontouchmove="event.preventDefault();">
+<body>
     <header>
         <a href="#" class="back"></a>
         <span>我提交的任务报告</span>

+ 1 - 1
main/assets/mobile/reportsubmit.html

@@ -8,7 +8,7 @@
     <title></title>
 <link href="./css/global.css?v=95681a6c" rel="stylesheet"><link href="./css/reportsubmit.css?v=95681a6c" rel="stylesheet"></head>
 
-<body ontouchmove="event.preventDefault();">
+<body>
     <header>
         <a href="#" class="back"></a>
         <span>提交任务报告</span>

+ 1 - 1
main/assets/mobile/task.html

@@ -8,7 +8,7 @@
     <title></title>
 <link href="./css/global.css?v=95681a6c" rel="stylesheet"><link href="./css/task.css?v=95681a6c" rel="stylesheet"></head>
 
-<body ontouchmove="event.preventDefault();">
+<body>
     <header>
         <a href="#" class="back"></a>
         <span>任务详情</span>

+ 1 - 1
main/assets/mobile/tasks.html

@@ -8,7 +8,7 @@
     <title></title>
 <link href="./css/global.css?v=95681a6c" rel="stylesheet"><link href="./css/tasks.css?v=95681a6c" rel="stylesheet"></head>
 
-<body ontouchmove="event.preventDefault();">
+<body>
     <header>
         <span>领任务</span>
     </header>

+ 1 - 1
main/assets/mobile/team.html

@@ -8,7 +8,7 @@
     <title></title>
 <link href="./css/global.css?v=95681a6c" rel="stylesheet"><link href="./css/team.css?v=95681a6c" rel="stylesheet"></head>
 
-<body ontouchmove="event.preventDefault();">
+<body>
     <header>
         <a href="#" class="back"></a>
         <span>我的小队</span>

+ 1 - 1
main/assets/mobile/updateprofile.html

@@ -8,7 +8,7 @@
     <title></title>
 <link href="./css/global.css?v=95681a6c" rel="stylesheet"><link href="./css/updateprofile.css?v=95681a6c" rel="stylesheet"></head>
 
-<body ontouchmove="event.preventDefault();">
+<body>
     <header>
         <a href="#" class="back"></a>
         <span>修改资料</span>

+ 11 - 4
task/lib/Cron.php

@@ -53,7 +53,7 @@ class Cron
     	$where['status'] = 2;
     	$where['score_status'] = 1;
     	$data = Dever::db('task/user_report')->state($where);
-
+        
     	if ($data) {
     		foreach ($data as $k => $v) {
     			$update['where_id'] = $v['id'];
@@ -66,7 +66,7 @@ class Cron
 
                 $this->updateMsg($v['uid'], $v['score'], 4, $v['task_id']);
 
-				$this->group($v['uid'], $v['group_score'], $v['task_id'], $v['id']);
+				$this->group($v['uid'], $v['group_score'], $v['task_id'], $v['id'], 1);
     		}
     	}
 
@@ -84,7 +84,7 @@ class Cron
     	$where['status'] = 3;
     	$where['cron'] = 1;
     	$data = Dever::db('task/user_cash')->state($where);
-
+        
     	if ($data) {
     		foreach ($data as $k => $v) {
     			$update['where_id'] = $v['id'];
@@ -126,7 +126,7 @@ class Cron
      *
      * @return mixed
      */
-    private function group($uid, $score, $task_id, $report_id)
+    private function group($uid, $score, $task_id, $report_id, $level = 1)
     {
     	$group_member = Dever::db('task/user_group_member')->one(array('uid' => $uid));
 		if ($group_member) {
@@ -138,6 +138,13 @@ class Cron
     			$this->updateScoreLog($group_info['uid'], $score, 5, 2, $task_id, $report_id, 1, 0, 0, '', $uid);
 
                 $this->updateMsg($group_info['uid'], $score, 5, $task_id, $uid);
+
+                # 继续寻找上线,带来收益
+                $config = Dever::config('base')->level;
+                $level = $level + 1;
+                if ($config >= $level) {
+                    $this->group($group_info['uid'], $score, $task_id, $report_id, $level);
+                }
 			}
 		}
     }

+ 2 - 0
task/src/Info.php

@@ -14,6 +14,8 @@ class Info extends Base
      */
     public function all()
     {
+        $this->checkUser();
+        
         $this->data['cate'] = Dever::db('task/cate')->state();
 
         $data = Dever::db('task/info')->getAll();