chengkun
2025-05-26 8f3df543230cd4403368b39b9bbe5726d11a0284
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<?php
 
 
 
class gqlist_controller extends common
{
 
    function index_action()
    {
 
        $this->get_moblie();
        $this->yunset('backurl', Url('wap'));
        $this->yunset('headertitle', '自由职业');
        $this->seo('gq_index');
        $this->yuntpl(array('wap/gqlist'));
    }
 
    function task_action()
    {
 
        $gqdemandM  =   $this->MODEL('gqdemand');
        $start_time =   strtotime(date('Y-m-d 00:00:00'));
        $end_time   =   strtotime(date('Y-m-d 23:59:59'));//开始时间
 
        $taskwhere['PHPYUNBTWSTATRT_A'] =   '';
        $taskwhere['ctime'][]           =   array('>', $start_time, 'AND');
        $taskwhere['ctime'][]           =   array('<', $end_time, 'AND');
        $taskwhere['PHPYUNBTWEND_A']    =   '';
 
        $taskwhere['uid']       =   $this->uid;
        $taskwhere['pay']       =   3;
 
        $mess   =   $gqdemandM->getTaskNum($taskwhere);
 
        if ($this->config['gq_pay_price'] == 0) {
 
            if ($this->config['gq_number'] > 0) {
 
                $num    =   $this->config['gq_number'] - $mess;
            } else {
 
                $num    =   $this->config['gq_number'];
            }
 
            $this->yunset("num", $num);
        }
        $this->get_moblie();
        $this->yunset('backurl', Url('wap', array('c' => 'gqlist')));
        $this->yunset('headertitle', '任务大厅');
        $this->seo('gq_task');
        $this->yuntpl(array('wap/gqtask'));
    }
 
 
    function taskshow_action()
    {
 
        $this->get_moblie();
 
        $gqdemandM  =   $this->MODEL('gqdemand');
 
        $uid        =   $this->uid;
 
        if ($_GET['id']) {
 
            $where['id']    =   intval($_GET['id']);
 
            $show           =   $gqdemandM->getGqtaskInfo($where, array('type' => 1));
 
            if (is_array($show) && $show) {
 
                if ($show['pay'] == 1 && $show['uid'] != $uid){
 
                    $this->ACT_msg_wap(Url('wap', array('c' => 'gqlist', 'a' => 'task')), '任务不存在!', 2, 5);
                }
 
                //统计添加记录
                $gqdemandM->getGqtaskhits(intval($_GET['id']), array('type' => 1));
 
                if ($uid != $show['uid'] && $uid) {
 
                    //查询一下  里面是否存在浏览记录
                    $browerwhere['task_id'] =   intval($_GET['id']);
                    $browerwhere['uid']     =   $this->uid;
 
                    $updata         =   array(
 
                        'uid'       =>  $this->uid,//浏览uid
                        'task_id'   =>  $show['id'],
                        'task_name' =>  $show['name'],
                        'gq_id'     =>  $show['uid'],//任务发布者id
                        'ctime'     =>  time()//更新时间
                    );
                    $gqdemandM->addbrowertask($browerwhere, $updata);
                }
            } else {
 
                $this->ACT_msg_wap(Url('wap', array('c' => 'gqlist', 'a' => 'task')), '任务不存在!', 2, 5);
            }
        }
 
        $this->yunset('show', $show);
        $this->yunset('backurl', Url('wap', array('c' => 'gqlist', 'a' => 'task')));
        $this->yunset('headertitle', '任务详情');
        $this->seo('gq_taskshow');
        $this->yuntpl(array('wap/gqtask_show'));
    }
 
    function free_action()
    {
 
        $this->get_moblie();
        $where['state']     =   1;
        $where['r_status']  =   1;
        $where['status']    =   1;
        if ($_GET['keyword']) {
 
            $where['name']      =   array('like', $_GET['keyword']);
            $urlarr['keyword']  =   $_GET['keyword'];
        }
 
        $urlarr['page']     =   '{{page}}';
        $pageurl            =   Url('wap', $urlarr);
 
        $pageM  =   $this->MODEL('page');
        $pages  =   $pageM->pageList('gq_info', $where, $pageurl, $_GET['page']);
        if ($pages['total'] > 0) {
 
            $where['orderby']   =   'uid';
            $where['limit']     =   $pages['limit'];
            $gqdemandM          =   $this->MODEL('gqdemand');
            $List               =   $gqdemandM->getGqinfoList($where);
            $this->yunset('rows', $List);
        }
 
        $this->yunset('backurl', Url('wap', array('c' => 'gqlist')));
        $this->yunset('headertitle', '自由职业者大厅');
        $this->seo('gq_free');
        $this->yuntpl(array('wap/gqfree'));
    }
 
    function freeshow_action()
    {
 
        $this->get_moblie();
 
        $gqdemandM  =   $this->MODEL('gqdemand');
 
        $where['state'] =   1;
 
        if ($_GET['id']) {
 
            $where['uid']   =   intval($_GET['id']);
            $show           =   $gqdemandM->getGqInfo($where);
            if (empty($show['uid'])) {
                $this->ACT_msg_wap(Url('wap', array('c' => 'gqlist', 'a' => 'free')), '任务不存在!', 2, 5);
            }
            $this->yunset('show', $show);
        }
 
        $this->yunset('backurl', Url('wap', array('c' => 'gqlist', 'a' => 'free')));
        $this->yunset('headertitle', '自由职业者');
        $this->seo('gq_freeshow');
        $this->yuntpl(array('wap/gqfree_show'));
    }
 
}
 
?>