Example #1
0
 function show()
 {
     $membersql = new membersql();
     $member_medal = new medal();
     $medalnews = array();
     $sql = 'SELECT * FROM ' . DB_PREFIX . 'medallog WHERE status=1 AND expiration>0 AND expiration<' . TIMENOW;
     $query = $this->db->query($sql);
     while ($row = $this->db->fetch_array($query)) {
         $medalnews[] = $row;
     }
     foreach ($medalnews as $medalnew) {
         $membersql->update('medallog', array('status' => 0), array('id' => $medalnew['id']));
         $membersql->delete('member_medal', array('member_id' => $medalnew['member_id'], 'medalid' => $medalnew['medalid']));
         $member_medal->update_used_num(array($medalnew['medalid']), '-');
     }
     $ret = "更新了已经过期会员勋章";
     $this->addItem($ret);
     $this->output();
 }
Example #2
0
 public function loginInfoRecord($member_id, $loginInfo)
 {
     class_exists('membersql') or (include CUR_CONF_PATH . 'core/membersql.core.php');
     $newLoginInfo = array();
     if (is_numeric($member_id) && $member_id > 0) {
         if (is_array($loginInfo)) {
             foreach ($loginInfo as $k => $v) {
                 if ($k == 'last_login_device') {
                     if ($v && $v != 'www' && $v != 'unknown') {
                         $newLoginInfo[$k] = $v;
                     }
                 } elseif ($v) {
                     $newLoginInfo[$k] = $v;
                 }
             }
         }
     }
     if ($newLoginInfo) {
         $membersql = new membersql();
         $membersql->update('member', $newLoginInfo, array('member_id' => $member_id));
         return true;
     }
     return false;
 }