示例#1
0
 function get_amount($user_id)
 {
     $user = new User();
     $gold = new gold();
     if ($user->where('id', $user_id)->count() == 0) {
         return false;
     }
     $user->get_by_id($user_id);
     $gold->where_related_user('id', $user->id)->get();
     return $gold->amount;
 }
示例#2
0
            $score = $result['score'];
            echo " <span>{$user1}</span>:金矿 {$score} 公斤<img src=\".\\hack\\gold\\image\\gold.jpg\"><br>";
        }
        echo "</div>";
        $sqlallscore = "SELECT name,money FROM pw_gold  ORDER BY money DESC  LIMIT 0 , 10";
        $resultallscore = $this->db->query($sqlallscore);
        echo "<div class=\"topallgold\"> <h3>淘金富翁排行榜</h3><br>";
        while ($resultall = $this->db->fetch_array($resultallscore)) {
            $user2 = $resultall['name'];
            $gmoney = $resultall['money'];
            echo "<span>{$user2}</span> :{$creditdb['name']} {$gmoney} {$creditdb['unit']}<img src=\".\\hack\\gold\\image\\gold.jpg\"><br>";
        }
        echo "</div></div>";
    }
}
$a = new gold($ngid, $nname, $db);
$tcid = $a->getcid();
$creditdb = $db->get_one("SELECT * FROM pw_credits WHERE cid=" . pwEscape($tcid));
//$creditdb['name']
$a->oc == 0 && showmsg('插件已关闭');
$a->inset_first_value();
$a->inset_first_point();
$wquery = "SELECT health,tool,toolname FROM pw_gold where id='{$ngid}' ";
$wresult = $db->query($wquery);
$wrow = $db->fetch_array($wresult);
if ($wrow['health'] < 5 or $wrow['toolname'] == '') {
    showmsg("你已经体力不支或工具严重破损,不能再挖金了,<a href=hack.php?H_name=stor >淘金商业街</a>转转吧!");
} else {
    $a->putout_user_msg();
    $ntoolname = $wrow['toolname'];
    switch ($ntoolname) {