public function doSiteDelete() { $uids = Request::post('uid', []); $member = new Member(); foreach ($uids as $uid) { $user = $member->where('siteid', SITEID)->find($uid); $user->destory(); } message('删除用户成功', 'back', 'success'); }
public function doWebConvert() { if (IS_POST) { $TicketModel = new \system\model\Ticket(); //兑换卡券 if (!$TicketModel->convert(q('post.tid'))) { message($TicketModel->getError(), 'back', 'error'); } message('兑换成功', '', 'success'); } $sql = "SELECT t.tid,t.credit,t.starttime,t.credittype,t.endtime,t.description,t.title,t.limit,t.thumb FROM " . tablename('ticket'); $sql .= " t LEFT JOIN " . tablename('ticket_record') . " tr ON t.tid=tr.tid " . "WHERE t.starttime<" . time() . " AND t.endtime>" . time(); $sql .= " AND t.type={$_GET['type']}" . " AND t.siteid=" . SITEID . " GROUP BY t.tid HAVING count(tr.id) < t.limit"; $data = Db::query($sql); $Member = new Member(); foreach ($data as $k => $v) { //兑换积分名称,积分或余额 $data[$k]['credit_title'] = $Member->getCreditTitle($v['credittype']); } View::with('data', $data); View::make($this->ucenter_template . '/ticket_convert.html'); }