dever há 7 anos atrás
pai
commit
078528f40c
5 ficheiros alterados com 236 adições e 629 exclusões
  1. 49 12
      task/database/info.php
  2. 48 0
      task/database/user_task.php
  3. 19 0
      task/lib/Base.php
  4. 100 0
      task/src/Info.php
  5. 20 617
      task/src/User.php

+ 49 - 12
task/database/info.php

@@ -169,45 +169,45 @@ return array
 			//'list'		=> true,
 		),
 
-		'report_num'		=> array
+		'report_cate_num'		=> array
 		(
 			'type' 		=> 'int-11',
-			'name' 		=> '报告数量上限',
+			'name' 		=> '同一类别参与次数',
 			'default' 	=> '0',
-			'match' 	=> '报告数量上限',
+			'match' 	=> '同一类别参与次数',
 			'match' 	=> 'is_numeric',
 			'update'	=> 'text',
 			//'list'		=> true,
 		),
 
-		'report_user_num'		=> array
+		'report_company_num'		=> array
 		(
 			'type' 		=> 'int-11',
-			'name' 		=> '人均报告数量',
+			'name' 		=> '同一商家参与次数',
 			'default' 	=> '0',
-			'match' 	=> '人均报告数量',
+			'match' 	=> '同一商家参与次数',
 			'match' 	=> 'is_numeric',
 			'update'	=> 'text',
 			//'list'		=> true,
 		),
 
-		'report_cate_num'		=> array
+		'report_num'		=> array
 		(
 			'type' 		=> 'int-11',
-			'name' 		=> '类别数量限制小于',
+			'name' 		=> '报告数量上限',
 			'default' 	=> '0',
-			'match' 	=> '类别数量限制小于',
+			'match' 	=> '报告数量上限',
 			'match' 	=> 'is_numeric',
 			'update'	=> 'text',
 			//'list'		=> true,
 		),
 
-		'report_company_num'		=> array
+		'report_user_num'		=> array
 		(
 			'type' 		=> 'int-11',
-			'name' 		=> '商家参与次数小于',
+			'name' 		=> '人均报告数量',
 			'default' 	=> '0',
-			'match' 	=> '商家参与次数小于',
+			'match' 	=> '人均报告数量',
 			'match' 	=> 'is_numeric',
 			'update'	=> 'text',
 			//'list'		=> true,
@@ -285,6 +285,21 @@ return array
 			'edit'		=> true,
 		),
 
+		'reorder'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '排序(数值越大越靠前)',
+			'default' 	=> '1',
+			'desc' 		=> '请输入排序',
+			'match' 	=> 'option',
+			'update'	=> 'text',
+			'search'	=> 'order',
+			'list_name' => '排序',
+			'list'		=> true,
+			'order'		=> 'desc',
+			'edit'		=> true,
+		),
+
 		'state'		=> array
 		(
 			'type' 		=> 'tinyint-1',
@@ -311,4 +326,26 @@ return array
 	(
 		
 	),
+
+
+	'request' => array
+	(
+		'getAll' => array
+		(
+			# 匹配的正则或函数 选填项
+			'option' => array
+			(
+				'company_id' => 'yes',
+				'level_id' => 'yes',
+				'cate_id' => 'yes',
+				'end' => array('yes-edate', '<'),
+				'status' => 1,
+				'state' => 1,
+			),
+			'type' => 'all',
+			'order' => array('reorder' => 'desc', 'cdate' => 'desc'),
+			'page' => array(15, 'list'),
+			'col' => '*',
+		),
+	)
 );

+ 48 - 0
task/database/user_task.php

@@ -6,6 +6,28 @@ $status = array
 	2 => '异常',
 );
 
+$company = function()
+{
+	$array = array();
+	$info = Dever::load('task/company-state');
+	if($info)
+	{
+		$array += $info;
+	}
+	return $array;
+};
+
+$cate = function()
+{
+	$array = array();
+	$info = Dever::load('task/cate-state');
+	if($info)
+	{
+		$array += $info;
+	}
+	return $array;
+};
+
 return array
 (
 	# 表名
@@ -63,6 +85,32 @@ return array
 			'list'		=> '{task_id} > 0 ? Dever::load("task/info-one#name", {task_id}) : "系统"',
 		),
 
+		'company_id'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '商家',
+			'default' 	=> '-1',
+			'desc' 		=> '商家',
+			'match' 	=> 'is_numeric',
+			//'update'	=> 'select',
+			'search'	=> 'select',
+			'option'	=> $company,
+			'list'		=> true,
+		),
+
+		'cate_id'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '类别',
+			'default' 	=> '-1',
+			'desc' 		=> '类别',
+			'match' 	=> 'is_numeric',
+			//'update'	=> 'select',
+			'search'	=> 'select',
+			'option'	=> $cate,
+			'list'		=> true,
+		),
+
 		'status'		=> array
 		(
 			'type' 		=> 'tinyint-1',

+ 19 - 0
task/lib/Base.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace Task\Lib;
+
+use Dever;
+
+class Base
+{
+    # 定义返回数据
+    protected $data;
+
+    public function __construct()
+    {
+        $this->data['config'] = Dever::db('main/config')->one(1);
+        $this->data['time'] = time();
+        $this->data['uid'] = Dever::input('uid', 1);
+        $this->data['session'] = Dever::input('session');
+    }
+}

+ 100 - 0
task/src/Info.php

@@ -0,0 +1,100 @@
+<?php
+
+namespace Task\Src;
+
+use Dever;
+use Task\Lib\Base;
+
+class Info extends Base
+{
+    /**
+     * 任务列表
+     *
+     * @return mixed
+     */
+    public function all()
+    {
+        $this->data['cate'] = Dever::db('task/cate')->state();
+
+        $data = Dever::db('task/info')->getAll();
+        if ($data) {
+            foreach ($data as $k => $v) {
+                $this->getOne($data[$k]);
+            }
+        }
+        return $data;
+    }
+
+    /**
+     * 任务详情
+     *
+     * @return mixed
+     */
+    public function one()
+    {
+        $id = Dever::input('id');
+        $info = array();
+        if ($id > 0) {
+            $this->data['cate'] = Dever::db('task/cate')->state();
+            $info = Dever::db('task/info')->one($id);
+            $this->getOne($info);
+        }
+        
+        return $info;
+    }
+
+    private function getOne(& $data)
+    {
+        # 多少人领取
+        $data['user_num'] = Dever::db('task/user_task')->total(array('task_id' => $data['id']));
+
+        # 3 金币/项
+        $data['list_score'] = $data['task_cash'] . ' ' . $this->data['config']['score_name'] . '/' . $this->data['config']['score_name_ext'];
+
+        # 组员贡献 1 金币/项
+        $data['list_group_score'] = '组员贡献 ' . $data['task_cash'] . ' ' . $this->data['config']['score_name'] . '/' . $this->data['config']['score_name_ext'];
+
+        #3 金币 + 1 金币
+        $data['score'] = $data['task_cash'] . ' ' . $this->data['config']['score_name'] . ' + ' . $data['task_cash'] . ' ' . $this->data['config']['score_name'];
+
+        # 任务类别
+        $data['cate'] = $this->data['cate'][$data['cate_id']];
+
+        # 任务时间
+        $data['sdate_str'] = date('Y.m.d', $data['sdate']);
+        $data['edate_str'] = date('Y.m.d', $data['edate']);
+
+        $data['button'] = $this->button($data);
+        
+    }
+
+    private function button($data)
+    {
+        # 领取任务按钮的状态
+        # 1 可以领取 2 任务已过期 3 抢光了 4 已领取 5 等级不够 6 已领取过该商家任务 7 已领取过该类别任务
+        # 大于1都不能点击
+        $button = 1;
+
+        if ($this->data['time'] > $data['edate']) {
+            # 任务已到期
+            $button = 2;
+        } elseif ($data['user_num'] >= $this->data['config']['num']) {
+            # 抢光了
+            $button = 3;
+        } elseif (isset($this->data['uid']) && $this->data['uid']) {
+            # 判断是否领取
+            $user = Dever::db('task/user_task')->one(array('task_id' => $data['id'], 'uid' => $this->data['uid']));
+
+            if ($user) {
+                # 已领取
+                $button = 4;
+            } else {
+                # 判断商家领取次数
+                $company = Dever::db('task/user_task')->total(array('company_id' => $data['company_id']));
+                if ($data['company_'])
+            }
+        }
+
+        return $button;
+    }
+}

+ 20 - 617
task/src/User.php

@@ -1,617 +1,20 @@
-<?php
-
-namespace Share\Src;
-
-use Dever;
-
-class User
-{
-    const INFO = 'set/info:applet';
-    const SHARE = 'comment/share:applet';
-    const USER = 'passport/user:applet';
-    const NEWS = 'content/news:applet';
-    const COURSE = 'content/course:applet';
-    const MEETING = 'content/meeting:applet';
-    const SERVICE = 'content/service:applet';
-    const ACTIVE = 'activity/active:applet';
-    const REFLUX = 'comment/share_reflux:applet';
-    const SHARELOG = 'comment/share_log:applet';
-    const SHAREGROUP = 'comment/share_group:applet';
-
-    /**
-     * 小程序列表
-     *
-     * @return mixed
-     */
-    public function applet()
-    {
-        $info = Dever::db(self::INFO);
-        $data = $info->state();
-        return $data;
-    }
-
-    /**
-     * 导入excel
-     *
-     * @return mixed
-     */
-    public function import()
-    {
-        $file = Dever::data() . 'user.xlsx';
-        $reader = new \PHPExcel_Reader_Excel2007();
-        if(!$reader->canRead($file)){
-            $reader = new \PHPExcel_Reader_Excel5();
-            if(!$reader->canRead($file)){
-                echo 'no Excel';
-                return ;
-            }
-        }
-         
-        $xls = $reader->load($file);
-        $currentSheet = $xls->getSheet(0);
-        $column = $currentSheet->getHighestColumn();
-        $row = $currentSheet->getHighestRow();
-
-        $group = $name = $wechat = array();
-        for ($curRow = 5;$curRow <= $row; $curRow++) {
-            for ($curColumn = 'A';$curColumn<= $column; $curColumn++) {
-                $value = $currentSheet->getCellByColumnAndRow(ord($curColumn) - 65,$curRow)->getValue();
-                if ($curColumn == 'B') {
-                    //分组
-                    if ($value) {
-                        $group_id = Dever::upinto('share/group', array('name' => $value), array('name' => $value));
-                    }
-                    
-                } elseif ($curColumn == 'C') {
-                    //姓名
-                    if ($value && isset($group_id) && $group_id) {
-                        Dever::upinto('share/user', array('name' => $value), array('group_id' => $group_id, 'name' => $value));
-                    }
-                } elseif ($curColumn == 'D') {
-                    //微信
-                    $wechat[$value] = $value;
-                }
-            }
-        }
-    }
-
-    /**
-     * 导出成excel
-     *
-     * @return mixed
-     */
-    public function out()
-    {
-        $applet = $this->applet();
-        $group = Dever::db('share/group')->state();
-        $user = Dever::db('share/user')->getAll();
-
-        $day = Dever::input('day');
-        if (!$day) {
-            $day = date('Y-m-d', time()-3600*24);
-        }
-        $start = Dever::maketime(date('Y-m-01 00:00:00', Dever::maketime($day)));
-        $end = Dever::maketime(date('Y-m-t 23:59:59', Dever::maketime($day)));
-        
-        $log = Dever::db('share/log')->state();
-        $i = 0;
-        foreach ($user as $k => $v) {
-            if (!$v['wechat_name']) {
-                unset($user[$k]);
-                continue;
-            }
-            
-            $user[$k]['group'] = $group[$v['group_id']]['name'];
-            $user[$k]['info'] = Dever::db('share/info')->one(array('share_day' => $day, 'user_id' => $v['id']));
-            if (!$user[$k]['info']) {
-                $user[$k]['info']['share_article_num'] = 0;
-                $user[$k]['applet'] = '未知';
-            } else {
-                $user[$k]['applet'] = array();
-                if ($user[$k]['info']['applet']) {
-                    $temp = explode(',', $user[$k]['info']['applet']);
-                    foreach ($temp as $k1 => $v1) {
-                        $user[$k]['applet'][$k1] = $applet[$v1]['name'];
-                    }
-                }
-                
-                $user[$k]['applet'] = implode("\r\n", $user[$k]['applet']);
-            }
-            $user[$k]['log'] = Dever::db('share/log')->state(array('share_day' => $day, 'user_id' => $v['id']));
-            $total = Dever::db('share/log')->month(array('start' => $start, 'end' => $end, 'user_id' => $v['id']));
-            $user[$k]['total'] = 0;
-            if ($total) {
-                $user[$k]['total'] = $total['num'];
-            }
-
-            if (!$user[$k]['total']) {
-                $user[$k]['total'] = 0;
-            }
-
-            $user[$k]['status'] = '已达标';
-            if ($user[$k]['info']['share_article_num'] < 3) {
-                $user[$k]['status'] = '未达标';
-            }
-
-            if ($user[$k]['name'] && $user[$k]['info']) {
-                $data[$i] = array
-                (
-                    $i+1,
-                    $user[$k]['group'],
-                    $user[$k]['name'],
-                    $user[$k]['wechat_name'],
-                    $user[$k]['applet'],
-                    $user[$k]['info']['share_article_num'],
-                    $user[$k]['total'],
-                    $user[$k]['status'],
-                );
-                $i++;
-            }
-        }
-        $header = array
-        (
-            '序号', '业务板块', '姓名', '微信昵称', '负责小程序名称', '分享文章数', '月总回流', '是否达标'
-        );
-
-        $file = $day . '_小程序推广';
-        if (Dever::input('test')) {
-            print_r($header);
-            print_r($data);die;
-        }
-        
-        Dever::excelExport($data, $header, $file, $sheet = 0, $sheetName = $day);
-        return;
-    }
-
-    public function test()
-    {
-        $name = '姓名';
-        $header = array
-        (
-            $name,'手机号'
-        );
-        $data = array
-        (
-            array
-            (
-                '于斌', '15810090845'
-            ),
-            array
-            (
-                '3', '4'
-            ),
-        );
-        Dever::excelExport($data, $header, $filename = 'test');
-    }
-
-    /**
-     * 获取数据
-     *
-     * @return mixed
-     */
-    public function data()
-    {
-        $user = Dever::db('share/user')->state();
-        foreach ($user as $k => $v) {
-            if ($v['wechat_name']) {
-                $user[$k] = $this->userData($v);
-            }
-        }
-        return true;
-    }
-
-    public function userData($data)
-    {
-        if ($data['uid']) {
-            $where = array
-            (
-                'option' => array
-                (
-                    'id' => array('yes', 'in'),
-                ),
-                'id' => explode(',', $data['uid']),
-            );
-            $user = Dever::db(self::USER)->state($where);
-        } else {
-            $user = Dever::db(self::USER)->state(array('name' => $data['wechat_name']));
-        }
-
-        $ids = array();
-        if ($user) {
-            $ids = array_keys($user);
-        }
-        
-        if ($ids) {
-            $user = array();
-            $option = array
-            (
-                'share_id' => 'yes',
-                'uid' => array('yes', 'in'),
-                'start' => array('yes-cdate', '>='),
-                'end' => array('yes-cdate', '<='),
-            );
-
-            //获取昨天数据
-            $time = time() - (3600 * 24);
-            $set = Dever::input('set');
-            if ($set) {
-                $time = Dever::maketime($set);
-            }
-            $day = date('Y-m-d', $time);
-            $day_prev = date('Y-m-d', strtotime("$day -1 day"));//前天
-
-            $start = date('Y-m-d 00:00:00', $time);
-            $end = date('Y-m-d 23:59:59', $time);
-            
-            $day_start = Dever::maketime($start);
-            $day_end = Dever::maketime($end);
-            $where = array
-            (
-                'option' => $option,
-                'uid' => $ids,
-                'start' => $day_start,
-                'end' => $day_end
-            );
-            $share = Dever::db(self::SHARE)->state($where);
-            if ($share) {
-                $user['applet'] = array();
-                //$user['applet'] = $data['applet'];
-                $user['user_id'] = $data['id'];
-                $user['share_day'] = $day;
-                $user['share_num'] = 0;
-                //$user['share_reflux_num'] = Dever::db(self::REFLUX)->total(array('source_uid' => $user['id']));
-                //获取月度回流
-                unset($where['option']['uid']);
-                $where['option']['source_uid'] = array('yes', 'in');
-                $where['source_uid'] = $ids;
-
-                //$user['share_reflux_num'] = Dever::db(self::REFLUX)->total($where);
-                $user['share_group_num'] = $user['share_reflux_num'] = 0;
-                $article = array();
-                foreach ($share as $k => $v) {
-                    $info = $this->shareData($v, $where, $article);
-                    if ($info) {
-                        $user['applet'][$info['applet']['id']] = $info['applet']['id'];
-                        $article[$info['source_table'] . '_' . $info['id']] = 1;
-                        $user['share'][$k] = $info;
-                        $user['share_num'] += $user['share'][$k]['num'];
-                        $user['share_group_num'] += $user['share'][$k]['group_num'];
-                        $user['share_reflux_num'] += $user['share'][$k]['reflux_num'];
-                    }
-                }
-
-                $user['applet'] = implode(',', $user['applet']);
-                $user['share_article_num'] = count($article);
-
-                $this->updateInfo($user, $day_prev);
-            }
-        }
-
-        return $user;
-    }
-
-
-    public function shareData($data, $where)
-    {
-        $result = array();
-        $table = false;
-        switch ($data['source_table']) {
-            case 1:
-                $table = self::NEWS;
-                break;
-            case 2:
-                $table = self::COURSE;
-                break;
-            case 3:
-                $table = self::MEETING;
-                break;
-            case 5:
-                $table = self::SERVICE;
-                break;
-            case 8:
-                $table = self::ACTIVE;
-                break;
-        }
-
-        if ($table && $data['source_id'] > 0) {
-            $info = Dever::db($table)->one($data['source_id']);
-            if ($info) {
-                $result['applet'] = Dever::db(self::INFO)->one($data['info_id']);
-                $result['source_table'] = $data['source_table'];
-                $result['id'] = $info['id'];
-                $result['name'] = $info['name'];
-                $result['time'] = date('Y-m-d H:i:s', $data['cdate']);
-                $result['cdate'] = $data['cdate'];
-                $result['num'] = $data['num'];
-                $result['group_num'] = $data['group_num'];
-
-                $where['share_id'] = $data['id'];
-                $result['reflux_num'] = Dever::db(self::REFLUX)->total($where);
-
-                unset($where['option']['source_uid']);
-
-                $result['num'] = Dever::db(self::SHARELOG)->total($where);
-                $result['group_num'] = Dever::db(self::SHAREGROUP)->total($where);
-
-                if ($result['num'] <= 0) {
-                    $result['reflux_num'] = 0;
-                }
-
-                if ($result['group_num'] > $result['num']) {
-                    $result['num'] = $result['group_num'];
-                }
-            }
-        }
-
-        return $result;
-    }
-
-    public function updateInfo($user, $day_prev)
-    {
-        # 获取上个月的数据 减去上个月的数据
-        /*
-        if ($user['share_day'] != $day_prev) {
-            $where = array();
-            $where['option_user_id'] = $user['user_id'];
-            $where['option_share_day'] = $day_prev;
-            $prev = Dever::db('share/info')->one($where);
-            if ($prev) {
-                $user['share_num'] = $user['share_num'] - $prev['share_num'];
-                $user['share_group_num'] = $user['share_group_num'] - $prev['share_group_num'];
-            }
-        }*/
-        $update = array();
-        $update['user_id'] = $user['user_id'];
-        $update['applet'] = $user['applet'];
-        $update['share_day'] = $user['share_day'];
-        $update['share_num'] = $user['share_num'];
-        $update['share_reflux_num'] = $user['share_reflux_num'];
-        $update['share_article_num'] = $user['share_article_num'];
-        $update['share_group_num'] = $user['share_group_num'];
-        $update['status'] = 1;
-        if ($update['share_article_num'] >= 3) {
-            $update['status'] = 2;
-        }
-
-        $where = array();
-        $where['option_user_id'] = $update['user_id'];
-        $where['option_share_day'] = $update['share_day'];
-
-        $info = Dever::db('share/info')->one($where);
-        if (!$info) {
-            $id = Dever::db('share/info')->insert($update);
-        } else {
-            $id = $info['id'];
-            $update['where_id'] = $id;
-            Dever::db('share/info')->update($update);
-        }
-
-        if ($id > 0 && isset($user['share'])) {
-            $user['share_num'] = 0;
-            $user['share_group_num'] = 0;
-            foreach ($user['share'] as $k => $v) {
-                $result = $this->updateLog($k, $v, $id, $update['user_id'], $user['share_day'], $day_prev);
-                if (isset($result['share_num'])) {
-                    $update['share_num'] += $result['share_num'];
-                }
-                if (isset($result['share_group_num'])) {
-                    $update['share_group_num'] += $result['share_group_num'];
-                }
-            }
-            if ($user['share_num'] > 0) {
-                $update = array();
-                $update['share_num'] = $user['share_num'];
-                $update['share_group_num'] = $user['share_group_num'];
-                $update['where_id'] = $id;
-                Dever::db('share/info')->update($update);
-            }
-        }
-    }
-
-    public function updateLog($share_id, $data, $info_id, $user_id, $day, $day_prev)
-    {
-        $prev = array();
-        /*
-        if ($day != $day_prev) {
-            $where = array();
-            $where['option_share_id'] = $share_id;
-            $where['option_user_id'] = $user_id;
-            $where['option_info_id'] = $info_id;
-            $where['option_source_id'] = $data['id'];
-            $where['option_share_day'] = $day_prev;
-            $where['option_applet'] = $data['applet']['id'];
-            $prev = Dever::db('share/log')->one($where);
-            if ($prev) {
-                $data['num'] = $data['num'] - $prev['share_num'];
-                $data['group_num'] = $data['group_num'] - $prev['share_group_num'];
-            }
-        }
-        */
-        $update = array();
-        $update['user_id'] = $user_id;
-        $update['info_id'] = $info_id;
-        $update['share_id'] = $share_id;
-        $update['share_day'] = $day;
-        $update['applet'] = $data['applet']['id'];
-        $update['name'] = $data['name'];
-        $update['source_id'] = $data['id'];
-        $update['source_table'] = $data['source_table'];
-        $update['share_num'] = $data['num'];
-        $update['sdate'] = $data['cdate'];
-        $update['share_group_num'] = $data['group_num'];
-        $update['share_reflux_num'] = $data['reflux_num'];
-
-        $where = array();
-        $where['option_share_id'] = $update['share_id'];
-        $where['option_user_id'] = $update['user_id'];
-        $where['option_info_id'] = $update['info_id'];
-        $where['option_source_id'] = $update['source_id'];
-        $where['option_share_day'] = $update['share_day'];
-        $where['option_applet'] = $update['applet'];
-
-        $info = Dever::db('share/log')->one($where);
-        if (!$info) {
-            Dever::db('share/log')->insert($update);
-        } else {
-            $update['where_id'] = $info['id'];
-            Dever::db('share/log')->update($update);
-        }
-
-        if ($prev) {
-            return array
-            (
-                'share_num' => $data['num'],
-                'share_group_num' => $data['group_num'],
-            );
-        }
-        return array();
-    }
-
-    /*
-    public function userMonthData($data)
-    {
-        $user = Dever::db(self::USER)->one(array('name' => $data['wechat_name']));
-        if ($user) {
-            $option = array
-            (
-                'share_id' => 'yes',
-                'uid' => 'yes',
-                'start' => array('yes-cdate', '>='),
-                'end' => array('yes-cdate', '<='),
-            );
-
-            //获取昨天数据
-            $time = time() - (3600 * 24);
-            $set = Dever::input('set');
-            if ($set) {
-                $time = Dever::maketime($set);
-            }
-            $month = date('Y-m-d', $time);
-            $month_end = date('Y-m-t', $time);
-            $month_cur = date('Y-m-d', $time);
-            $month_prev = date('Y-m', strtotime("$month -1 month"));//上个月
-
-            $start = date('Y-m-01 00:00:00', $time);
-            if ($month_end == $month_cur || $set) {
-                $user['status'] = 1;//本月已经到月底
-                $end = date('Y-m-t 23:59:59', $time);
-            } else {
-                $user['status'] = 2;//本月还未到月底
-                $end = date('Y-m-d 23:59:59', $time);
-            }
-            
-            $month_start = Dever::maketime($start);
-            $month_end = Dever::maketime($end);
-            $where = array
-            (
-                'option' => $option,
-                'uid' => $user['id'],
-                'start' => $month_start,
-                'end' => $month_end
-            );
-            $share = Dever::db(self::SHARE)->state($where);
-            if ($share) {
-                $user['applet'] = $data['applet'];
-                $user['user_id'] = $data['id'];
-                $user['share_month'] = $month;
-                $user['share_month_se'] = $start . '-' . $end;
-                $user['share_num'] = 0;
-                //$user['share_reflux_num'] = Dever::db(self::REFLUX)->total(array('source_uid' => $user['id']));
-                //获取月度回流
-                unset($where['option']['uid']);
-                $where['option']['source_uid'] = $user['id'];
-
-                $user['share_month_reflux_num'] = Dever::db(self::REFLUX)->total($where);
-                $user['share_group_num'] = 0;
-                foreach ($share as $k => $v) {
-                    $info = $this->shareData($v, $where);
-                    if ($info && $info['num'] > 0) {
-                        $user['share'][$k] = $info;
-                        $user['share_num'] += $user['share'][$k]['num'];
-                        $user['share_group_num'] += $user['share'][$k]['group_num'];
-                    }
-                }
-
-                $this->updateInfo($user, $month_prev);
-            }
-        }
-
-        return $user;
-    }
-
-    public function updateInfo($user, $month_prev)
-    {
-        # 获取上个月的数据 减去上个月的数据
-        if ($user['share_month'] != $month_prev) {
-            $where = array();
-            $where['option_user_id'] = $user['user_id'];
-            $where['option_share_month'] = $month_prev;
-            $prev = Dever::db('share/info')->one($where);
-            if ($prev) {
-                $user['share_num'] = $user['share_num'] - $prev['share_num'];
-                $user['share_group_num'] = $user['share_group_num'] - $prev['share_group_num'];
-            }
-        }
-        $update = array();
-        $update['user_id'] = $user['user_id'];
-        $update['applet'] = $user['applet'];
-        $update['share_month'] = $user['share_month'];
-        $update['share_month_se'] = $user['share_month_se'];
-        $update['share_num'] = $user['share_num'];
-        $update['share_month_reflux_num'] = $user['share_month_reflux_num'];
-        $update['share_group_num'] = $user['share_group_num'];
-        $update['status'] = $user['status'];
-
-        $where = array();
-        $where['option_user_id'] = $update['user_id'];
-        $where['option_share_month'] = $update['share_month'];
-
-        $info = Dever::db('share/info')->one($where);
-        if (!$info) {
-            $id = Dever::db('share/info')->insert($update);
-        } else {
-            $id = $info['id'];
-            $update['where_id'] = $id;
-            Dever::db('share/info')->update($update);
-        }
-
-        if ($id > 0 && $user['share']) {
-            foreach ($user['share'] as $k => $v) {
-                $this->updateLog($k, $v, $id, $update['user_id'], $user['share_month']);
-            }
-        }
-    }
-
-    public function updateLog($share_id, $data, $info_id, $user_id, $month)
-    {
-        $update = array();
-        $update['user_id'] = $user_id;
-        $update['info_id'] = $info_id;
-        $update['share_id'] = $share_id;
-        $update['share_month'] = $month;
-        $update['applet'] = $data['applet']['id'];
-        $update['name'] = $data['name'];
-        $update['source_id'] = $data['id'];
-        $update['source_table'] = $data['source_table'];
-        $update['share_num'] = $data['num'];
-        $update['sdate'] = $data['cdate'];
-        $update['share_group_num'] = $data['group_num'];
-        $update['share_reflux_num'] = $data['month_reflux_num'];
-
-        $where = array();
-        $where['option_share_id'] = $update['share_id'];
-        $where['option_user_id'] = $update['user_id'];
-        $where['option_info_id'] = $update['info_id'];
-        $where['option_source_id'] = $update['source_id'];
-        $where['option_share_month'] = $update['share_month'];
-        $where['option_applet'] = $update['applet'];
-
-        $info = Dever::db('share/log')->one($where);
-        if (!$info) {
-            Dever::db('share/log')->insert($update);
-        } else {
-            $update['where_id'] = $info['id'];
-            Dever::db('share/log')->update($update);
-        }
-    }*/
-}
+<?php
+
+namespace Task\Src;
+
+use Dever;
+
+class User
+{
+    /**
+     * 任务列表
+     *
+     * @return mixed
+     */
+    public function list()
+    {
+        $info = Dever::db(self::INFO);
+        $data = $info->state();
+        return $data;
+    }
+}