本文整理匯總了PHP中Table::findAll方法的典型用法代碼示例。如果您正苦於以下問題:PHP Table::findAll方法的具體用法?PHP Table::findAll怎麽用?PHP Table::findAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Table
的用法示例。
在下文中一共展示了Table::findAll方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Table
<?php
/**
* 統計下狀態正常的產品信息數量
*/
$tableObj = new Table("txonline");
$id = 0;
$num = 0;
while (1) {
$mysqlRs = $tableObj->findAll("select id, keyword, state from gckeyword.key_proword where id > '" . $id . "' order by id asc limit 100");
if (empty($mysqlRs)) {
exit("統計完畢\n");
}
foreach ($mysqlRs as $value) {
$id = $value["id"];
echo $id . "\t" . $num . "\n";
if ($value["state"] < 0) {
continue;
}
$num++;
}
}
class Config
{
public static $dbArr = array('localhost' => array('192.168.12.70', "root", "123456", "test"), 'online' => array('192.168.2.163', "gongchangdb", "gongchangdb7232275", "caijiproductinfo"), 'info' => array('192.168.2.101', 'hangye', 'hangye7232275', 'hangye'), 'local' => array('192.168.8.18', 'root', 'gc7232275', 'gcoperate'), "local170" => array('192.168.8.170', "root", "gc7232275", "test"), 'local189' => array('192.168.8.189', 'gongchang', 'gongchang123', 'gckeyword'), 'main' => array('read.mysql.ch.gongchang.com', 'gcwork', 'gcwork7232275', 'catesearch'), 'maind' => array('write.mysql.ch.gongchang.com', 'gcwork', 'gcwork7232275', 'catesearch'), "product" => array("pdinfo.read.mysql.ch.gongchang.com", "gccontent", "gccontent7232275", "caijiproductinfo"), 'club' => array('55651c3e54ae6.sh.cdb.myqcloud.com', 'cdb_outerroot', 'ScIwH*3fEB(', 'cn_clubnew', 8287), 'txonline' => array('172.17.18.4', 'gckeyword', 'WVwVaxADjX9z3PHd', 'gckeyword'));
public static $cateApiUrl = 'http://cate.ch.gongchang.com/cate_json/';
}
class Table
{
public $conn = '';
public $config;
示例2: __construct
*/
header("Content-type:text/html;charset=utf-8");
define("ROOT", substr(__FILE__, 0, stripos(__FILE__, "tianyunchong.select")));
$conn = new Table("local198");
$cateid = isset($_GET["cateid"]) ? trim($_GET["cateid"]) : "";
if (empty($cateid)) {
$parentid = 0;
} else {
$cateInfo = $conn->findOne("select * from fbcateinfo.fbcate_cateinfo where cateid='" . $cateid . "' limit 1");
if ($cateInfo) {
$parentid = $cateInfo["cateid"];
} else {
$parentid = 0;
}
}
$cateArr = $conn->findAll("select * from fbcateinfo.fbcate_cateinfo where parentid='{$parentid}' limit 100");
require ROOT . 'tianyunchong.select/templates/forbuyers/catechild.phtml';
class Config
{
public static $dbArr = array('localhost' => array('192.168.12.70', "root", "123456", "test"), 'online' => array('192.168.2.163', "gongchangdb", "gongchangdb7232275", "caijiproductinfo"), 'info' => array('192.168.2.101', 'hangye', 'hangye7232275', 'hangye'), 'local' => array('192.168.8.18', 'root', 'gc7232275', 'gcoperate'), "local170" => array('192.168.8.170', "root", "gc7232275", "test"), 'local189' => array('192.168.8.189', 'gongchang', 'gongchang123', 'gckeyword'), 'local198' => array('192.168.8.198', 'root', '123456', 'fbproduct'), 'main' => array('read.mysql.ch.gongchang.com', 'gcwork', 'gcwork7232275', 'catesearch'), 'maind' => array('write.mysql.ch.gongchang.com', 'gcwork', 'gcwork7232275', 'catesearch'), "product" => array("pdinfo.read.mysql.ch.gongchang.com", "gccontent", "gccontent7232275", "caijiproductinfo"), 'club' => array('55651c3e54ae6.sh.cdb.myqcloud.com', 'cdb_outerroot', 'ScIwH*3fEB(', 'cn_clubnew', 8287), 'txonline' => array('172.17.18.4', 'gckeyword', 'WVwVaxADjX9z3PHd', 'gckeyword'));
public static $cateApiUrl = 'http://cate.ch.gongchang.com/cate_json/';
}
class Table
{
public $conn = '';
public $config;
public function __construct($connName)
{
$db = Config::$dbArr;
$this->config = $db[$connName];
try {
示例3: Table
<?php
/**
* 初始化所有的關鍵詞組
*/
include_once "common.php";
$conn = new Table("local189");
$conn->query("TRUNCATE TABLE `tianyunzi`.`360_group`");
$jihuaArr = $conn->findAll("select * from tianyunzi.360_jihua limit 100");
$api = "https://api.e.360.cn/account/clientLogin";
$postData = array("format" => "json", "username" => "鄭州悉知", "passwd" => "7232275XZgcw");
$md = md5("7232275XZgcw");
$key = "15fdeq7buepvssh8z899rusa6ynxufyn";
$m = new Xcrypt(substr($key, 0, 16), 'cbc', substr($key, 16, 16));
$postData["passwd"] = $m->encrypt($md, 'hex');
$header = array();
$header[] = "serveToken:" . microtime(1);
$header[] = "apiKey:1kg8tunzfxt8zvzpf53vjr5es45lvszh";
$str = curlPost($api, $header, $postData);
if (!isset($str["accessToken"])) {
exit("用戶登錄驗證失敗!\n");
} else {
echo "用戶登錄驗證成功!\n";
}
$header[] = "accessToken:" . $str["accessToken"];
$header[] = "sessionToken:" . $str["sessionToken"];
foreach ($jihuaArr as $value) {
$api = "https://api.e.360.cn/2.0/group/getIdListByCampaignId";
$params = array("format" => "json", "campaignId" => intval($value["id"]));
$str = curlPost($api, $header, $params);
if (!isset($str["groupIdList"])) {
示例4: Table
<?php
/**
* 初始化所有的關鍵詞入庫
*/
include_once "common.php";
$conn = new Table("local189");
$conn->query("TRUNCATE TABLE `tianyunzi`.`360_keywords`");
$jihuaArr = $conn->findAll("select * from tianyunzi.360_jihua limit 100");
$api = "https://api.e.360.cn/account/clientLogin";
$postData = array("format" => "json", "username" => "鄭州悉知", "passwd" => "7232275XZgcw");
$md = md5("7232275XZgcw");
$key = "15fdeq7buepvssh8z899rusa6ynxufyn";
$m = new Xcrypt(substr($key, 0, 16), 'cbc', substr($key, 16, 16));
$postData["passwd"] = $m->encrypt($md, 'hex');
$header = array();
$header[] = "serveToken:" . microtime(1);
$header[] = "apiKey:1kg8tunzfxt8zvzpf53vjr5es45lvszh";
$str = curlPost($api, $header, $postData);
if (!isset($str["accessToken"])) {
exit("用戶登錄驗證失敗!\n");
} else {
echo "用戶登錄驗證成功!\n";
}
$header[] = "accessToken:" . $str["accessToken"];
$header[] = "sessionToken:" . $str["sessionToken"];
$groupid = 0;
while (1) {
$groupArr = $conn->findAll("select * from tianyunzi.360_group where id > '{$groupid}' order by id asc limit 100");
if (empty($groupArr)) {
exit("所有的關鍵詞處理完畢\n");
示例5: Table
<?php
/**
* 用戶信息轉移
* @author tianyunchong
* @datetime 2016/05/26
*/
ini_set('magic_quotes_gpc', "1");
include_once "../common.php";
$conn = new Table("forbuyers-test");
$connLocal = new Table("local198");
$supid = 0;
while (1) {
$userArr = $conn->findAll("select * from fbsupplier.fb_sup_user where supid > '" . $supid . "' limit 100");
if (empty($userArr)) {
break;
}
foreach ($userArr as $value) {
$supid = $value["supid"];
$existArr = $connLocal->findOne("select * from fbsupplier.fb_sup_user where supid = '" . $supid . "' limit 1");
if ($existArr) {
continue;
}
/** 郵箱不能重複 */
$existArr = $connLocal->findOne("select * from fbsupplier.fb_sup_user where email = '" . $value["email"] . "' limit 1");
if ($existArr) {
continue;
}
$value["notice"] = intval($value["notice"]);
$connLocal->insert($value, "fbsupplier.fb_sup_user");
echo $supid . "\t" . $value["username"] . "\n";
示例6: updateKeyword
<?php
$localObj = new Table("local");
$onlineObj = new Table("txonline");
$id = 358403;
while (1) {
echo $id, "\n";
$resultRs = $localObj->findAll("select * from tianyunzi.phome_ecms_keywords where id > '{$id}' order by id asc limit 100");
if (empty($resultRs)) {
exit("所有數據處理完畢\n");
}
foreach ($resultRs as $value) {
$id = $value["id"];
updateKeyword($value);
}
}
function updateKeyword($keywordArr)
{
global $onlineObj;
$keywordMysql = $onlineObj->findOne("select * from gckeyword.key_proword where keyword = '" . $keywordArr["title"] . "' limit 1");
if (empty($keywordMysql)) {
echo $keywordArr['title'] . " 不在當前詞庫中存在!\n";
return false;
}
//開始更新數據
$mainword = array_filter(explode("|", $keywordArr["mainword"]));
$mainword = getMysqlJson($mainword);
$f_word = array_filter(explode("|", $keywordArr["f_word"]));
if (empty($f_word)) {
$f_word = $keywordMysql["redword"];
} else {
示例7: exit
/** 開查下用戶信息 */
$userInfo = $conn18->findOne("select * from alienglish.fb_sup_user where supid = '" . $uid . "' limit 1");
if (empty($userInfo)) {
exit("用戶信息不存在!");
}
/** 開查下企業信息 */
$comInfo = $conn18->findOne("select * from alienglish.fb_company where supid = '" . $uid . "' limit 1");
if (empty($comInfo)) {
exit("企業信息不存在!");
}
$cid = $comInfo["cid"];
$domain = $comInfo["domain"];
/** 開查下產品信息 */
$id = 0;
while (1) {
$productMapArr = $conn18->findAll("select * from alienglish.pd_cate where id > '" . $id . "' order by id asc limit 100");
if (empty($productMapArr)) {
break;
}
foreach ($productMapArr as $value) {
$id = $value["id"];
if ($value["domain"] != $domain) {
echo "alipid\t" . $value["alipid"] . "\t跳過\n";
continue;
}
$alipid = $value["alipid"];
$productData = $conn18->findOne("select * from alienglish.pd_info where alipid = '" . $alipid . "' limit 1");
if (empty($productData)) {
continue;
}
/** 開始處理單條的產品信息 */
示例8: Table
<?php
/**
* 獲取下所有的關鍵詞處理標記為競價
*/
$id = 0;
/* 清空下所有的關鍵詞 */
$beanstalk = new \Phalcon\Queue\Beanstalk(array("host" => "172.17.16.101", "port" => 11300));
while (1) {
$conn = new Table("local");
$groupArr = $conn->findAll("select * from tianyunzi.baidu_group where id > '{$id}' order by id asc limit 100");
if (empty($groupArr)) {
echo "所有的單元已經過完\n";
exit;
}
foreach ($groupArr as $value) {
$id = $value["id"];
/* 獲取當前單元下的所有關鍵詞 */
$keywordArr = getKeyword($value["id"]);
if (empty($keywordArr) || !isset($keywordArr["body"]["data"])) {
echo "計劃[" . $value["jihuaname"] . "],單元[" . $value["groupname"] . "],沒有查到關鍵詞\n";
continue;
}
foreach ($keywordArr["body"]["data"] as $value1) {
/* 插入數據庫 */
$insertArr = array("id" => $value1["keywordId"], "campaignId" => $value1["campaignId"], "adgroupId" => $value1["adgroupId"], "keyword" => $value1["keyword"], "pcDestinationUrl" => $value1["pcDestinationUrl"]);
echo $insertArr["keyword"] . "\n";
writeBeans($insertArr["keyword"]);
//file_put_contents("/tmp/keyword.log", $insertArr["keyword"] . "\n", FILE_APPEND);
}
}
示例9: Table
<?php
/**
* 處理下存在全毛的相關分類
*/
$id = 0;
$conn = new Table("txonline");
$beanstalk = new \Phalcon\Queue\Beanstalk(array("host" => "172.17.16.101", "port" => 11300));
while (1) {
$keywordMysql = $conn->findAll("select id, keyword, relacateid from gckeyword.key_proword where id > '{$id}' order by id asc limit 100");
if (empty($keywordMysql)) {
exit("所有數據處理完畢");
}
foreach ($keywordMysql as $value) {
$id = $value["id"];
if (!strstr($value["relacateid"], "1270")) {
continue;
}
$conn->update("update gckeyword.key_proword set relacateid = '' where id = '" . $value["id"] . "'");
try {
$beanstalk->choose('v3www_prokeyword_rela');
echo $beanstalk->put($value["id"], array('priority' => 1024, 'delay' => 0, 'ttr' => 86400)), "\n";
} catch (\Exception $e) {
}
exit;
}
}
class Config
{
public static $dbArr = array('localhost' => array('192.168.12.70', "root", "123456", "test"), 'online' => array('192.168.2.163', "gongchangdb", "gongchangdb7232275", "caijiproductinfo"), 'info' => array('192.168.2.101', 'hangye', 'hangye7232275', 'hangye'), 'local' => array('192.168.8.18', 'root', 'gc7232275', 'gcoperate'), "local170" => array('192.168.8.170', "root", "gc7232275", "test"), 'local189' => array('192.168.8.189', 'gongchang', 'gongchang123', 'gckeyword'), 'main' => array('read.mysql.ch.gongchang.com', 'gcwork', 'gcwork7232275', 'catesearch'), 'maind' => array('write.mysql.ch.gongchang.com', 'gcwork', 'gcwork7232275', 'catesearch'), "product" => array("pdinfo.read.mysql.ch.gongchang.com", "gccontent", "gccontent7232275", "caijiproductinfo"), 'club' => array('55651c3e54ae6.sh.cdb.myqcloud.com', 'cdb_outerroot', 'ScIwH*3fEB(', 'cn_clubnew', 8287), 'txonline' => array('172.17.18.4', 'gckeyword', 'WVwVaxADjX9z3PHd', 'gckeyword'));
public static $cateApiUrl = 'http://cate.ch.gongchang.com/cate_json/';
示例10: Table
<?php
/**
* 產品信息索引信息入庫
*/
include_once "../common.php";
$conn = new Table("local198");
$pid = 0;
while (1) {
$productArr = $conn->findAll("select * from fbproduct.pd_info where pid > '" . $pid . "' order by pid asc limit 100");
if (empty($productArr)) {
break;
}
foreach ($productArr as $value) {
$pid = $value["pid"];
/** 獲取下企業信息 */
$companyArr = $conn->findOne("select * from fbsupplier.fb_company where cid = '" . $value["cid"] . "' limit 1");
$userArr = $conn->findOne("select * from fbsupplier.fb_sup_user where supid = '" . $value["uid"] . "' limit 1");
$esArr = array("pid" => $value["pid"], "proname" => $value["proname"], "prokey" => $value["prokey"], "property" => getProperty($value["property"], $value["userproperty"]), "cate1" => $value["cate1"], "cate2" => $value["cate2"], "cate3" => $value["cate3"], "cate4" => $value["cate4"], "categoryid" => $value["cate4"] ? $value["cate4"] : ($value["cate3"] ? $value["cate3"] : $value["cate2"]), "groupid" => getGroupIdArr($value["pid"]), "pubtime" => $value["pubtime"], "uptime" => $value["uptime"], "star" => $value["star"], "province" => $companyArr["province"], "city" => $companyArr["city"], "cid" => $value["cid"], "uid" => $value["uid"], "is_verified" => $companyArr["is_verfied"], "is_vip" => $companyArr["is_vip"], "mobile_verified" => $userArr["mobile_checked"], "email_verified" => $userArr["email_checked"], "mincount" => $value["mincount"], "state" => $value["state"]);
/** 開始創建es */
$params = array("index" => "forbuyers_product", "type" => "product", "id" => $esArr["pid"], "body" => $esArr);
$response = $client->index($params);
if (isset($response["created"]) && $response["created"]) {
echo $pid . "\tcreat success!\n";
}
}
}
/**
* 獲取產品分組
*
* @Author tianyunzi
示例11: Table
/**
* 開始更新處理百度關鍵詞
*/
define("ROOT", "/data/cap/php/");
$conn = new Table("local");
$fp = fopen(ROOT . "baidu1.csv", "r");
while ($data = fgetcsv($fp)) {
if (empty($data[0]) || $data[0] == "關鍵詞") {
continue;
}
$jihua = trim($data[0]);
$group = trim($data[1]);
$keyword = trim($data[2]);
$url = trim($data[3]);
$keywordRs = $conn->findAll("select * from tianyunzi.baidu_keywords where keyword = '" . $keyword . "' limit 10");
if (count($keywordRs) <= 1) {
echo $keyword . "\n";
continue;
}
$jihuaArr = $conn->findOne("select * from tianyunzi.baidu_jihua where name = '" . $jihua . "' limit 1");
if (empty($jihuaArr)) {
echo "============未知的計劃" . $jihua . "==================\n";
continue;
}
$groupArr = $conn->findOne("select * from tianyunzi.baidu_group where groupname = '" . $group . "' limit 1");
if (empty($groupArr)) {
echo "==============未知的分組" . $group . "=================\n";
continue;
}
$keywordRs = $conn->findOne("select * from tianyunzi.baidu_keywords where keyword = '" . $keyword . "' and campaignId = '" . $jihuaArr["id"] . "' and adgroupId = '" . $groupArr["id"] . "' limit 1");
示例12: Table
<?php
/**
* 幫助中心信息處理
* 把您改成你
*/
$onlineObj = new Table("txonline");
$id = 0;
while (1) {
$mysqlRs = $onlineObj->findAll("select * from gcbuyer.com_article where id > '{$id}' order by id asc limit 100");
if (empty($mysqlRs)) {
exit("所有信息處理完畢");
}
foreach ($mysqlRs as $value) {
$id = $value["id"];
echo $id;
echo "\n";
$checkStr = $value["articletitle"] . $value["content"] . $value["smalltext"];
if (strstr($checkStr, "您") || strstr($checkStr, "賬號") || strstr($checkStr, "賬戶")) {
var_dump($value);
echo "\n";
$updateArr = array("articletitle" => str_replace(array("您", "賬號", "賬戶"), array("你", "帳號", "帳戶"), $value["articletitle"]), "content" => str_replace(array("您", "賬號", "賬戶"), array("你", "帳號", "帳戶"), $value["content"]), "smalltext" => str_replace(array("您", "賬號", "賬戶"), array("你", "帳號", "帳戶"), $value["smalltext"]));
$onlineObj->update("update gcbuyer.com_article set articletitle = '" . $updateArr["articletitle"] . "', content = '" . $updateArr["content"] . "', smalltext = '" . $updateArr["smalltext"] . "' where id = '" . $value["id"] . "'");
} else {
continue;
}
}
}
class Config
{
public static $dbArr = array('localhost' => array('192.168.12.70', "root", "123456", "test"), 'online' => array('192.168.2.163', "gongchangdb", "gongchangdb7232275", "caijiproductinfo"), 'info' => array('192.168.2.101', 'hangye', 'hangye7232275', 'hangye'), 'local' => array('192.168.8.18', 'root', 'gc7232275', 'gcoperate'), "local170" => array('192.168.8.170', "root", "gc7232275", "test"), 'local189' => array('192.168.8.189', 'gongchang', 'gongchang123', 'gckeyword'), 'main' => array('read.mysql.ch.gongchang.com', 'gcwork', 'gcwork7232275', 'catesearch'), 'maind' => array('write.mysql.ch.gongchang.com', 'gcwork', 'gcwork7232275', 'catesearch'), "product" => array("pdinfo.read.mysql.ch.gongchang.com", "gccontent", "gccontent7232275", "caijiproductinfo"), 'club' => array('55651c3e54ae6.sh.cdb.myqcloud.com', 'cdb_outerroot', 'ScIwH*3fEB(', 'cn_clubnew', 8287), 'txonline' => array('172.17.18.4', 'root', 'gc7232275', 'gckeyword'));
示例13: __construct
<?php
/**
* 打入相關關鍵詞預熱腳本
*/
$id = 46607377;
$config = array('172.17.16.101', 11300);
$queue = new \Phalcon\Queue\Beanstalk(array("host" => $config[0], "port" => $config[1]));
$conn = new Table("txonline");
$keywordRs = $conn->findAll("select id, keyword from gckeyword.key_proword where id >=46607318 and id <= 46607375 limit 100");
foreach ($keywordRs as $value) {
echo $value["id"] . "\n";
try {
$queue->choose('v3www_prokeyword_rela');
echo $queue->put($value["id"], array('priority' => 1024, 'delay' => 0, 'ttr' => 86400)), "\n";
} catch (\Exception $e) {
}
}
class Config
{
public static $dbArr = array('localhost' => array('192.168.12.70', "root", "123456", "test"), 'online' => array('192.168.2.163', "gongchangdb", "gongchangdb7232275", "caijiproductinfo"), 'info' => array('192.168.2.101', 'hangye', 'hangye7232275', 'hangye'), 'local' => array('192.168.8.18', 'root', 'gc7232275', 'gcoperate'), "local170" => array('192.168.8.170', "root", "gc7232275", "test"), 'local189' => array('192.168.8.189', 'gongchang', 'gongchang123', 'gckeyword'), 'main' => array('read.mysql.ch.gongchang.com', 'gcwork', 'gcwork7232275', 'catesearch'), 'maind' => array('write.mysql.ch.gongchang.com', 'gcwork', 'gcwork7232275', 'catesearch'), "product" => array("pdinfo.read.mysql.ch.gongchang.com", "gccontent", "gccontent7232275", "caijiproductinfo"), 'club' => array('55651c3e54ae6.sh.cdb.myqcloud.com', 'cdb_outerroot', 'ScIwH*3fEB(', 'cn_clubnew', 8287), 'txonline' => array('172.17.18.4', 'gckeyword', 'WVwVaxADjX9z3PHd', 'gckeyword'));
public static $cateApiUrl = 'http://cate.ch.gongchang.com/cate_json/';
}
class Table
{
public $conn = '';
public $config;
public function __construct($connName)
{
$db = Config::$dbArr;
$this->config = $db[$connName];
示例14: Table
<?php
/**
* 清除掉社區采集的問答
*/
$clubObj = new Table("club");
$id = 1143160;
$fids = array(155, 156, 157, 158);
while (1) {
$mysqlRs = $clubObj->findAll("select * from pre_forum_thread where tid > '{$id}' order by tid asc limit 100");
if (empty($mysqlRs)) {
exit("所有數據處理完畢!");
}
foreach ($mysqlRs as $value) {
$id = $value["tid"];
echo $id . "\n";
if (!in_array($value["fid"], $fids)) {
continue;
}
if ($value["authorid"] != "2563479") {
continue;
}
var_dump($value);
echo "\n";
$clubObj->query("delete from pre_forum_thread where tid = '" . $value["tid"] . "'");
}
}
class Config
{
public static $dbArr = array('localhost' => array('192.168.12.70', "root", "123456", "test"), 'online' => array('192.168.2.163', "gongchangdb", "gongchangdb7232275", "caijiproductinfo"), 'info' => array('192.168.2.101', 'hangye', 'hangye7232275', 'hangye'), 'local' => array('192.168.8.18', 'root', 'gc7232275', 'gcoperate'), "local170" => array('192.168.8.170', "root", "gc7232275", "test"), 'local189' => array('192.168.8.189', 'gongchang', 'gongchang123', 'gckeyword'), 'main' => array('read.mysql.ch.gongchang.com', 'gcwork', 'gcwork7232275', 'catesearch'), 'maind' => array('write.mysql.ch.gongchang.com', 'gcwork', 'gcwork7232275', 'catesearch'), "product" => array("pdinfo.read.mysql.ch.gongchang.com", "gccontent", "gccontent7232275", "caijiproductinfo"), 'club' => array('172.17.18.2', 'root', 'gc7232275', 'cn_clubnew', 3306), 'txonline' => array('172.17.18.4', 'gckeyword', 'WVwVaxADjX9z3PHd', 'gckeyword'));
public static $cateApiUrl = 'http://cate.ch.gongchang.com/cate_json/';
示例15: getComUrl
<?php
/**
* 企業詳情seo需要打入隊列處理數據
*/
define("APP_DEV", "dev");
if (APP_DEV == 'dev') {
$cfg = array('host' => '192.168.8.18', 'port' => '5672', 'login' => 'admin', 'password' => 'gc7232275', 'vhost' => '/');
$txonline = new Table("local189");
} else {
$cfg = array('host' => '172.17.16.108', 'port' => '5672', 'login' => 'admin', 'password' => 'gc7232275', 'vhost' => '/');
$txonline = new Table("txonline");
}
$id = 0;
while (1) {
$mysqlRs = $txonline->findAll("select cid,province from combusiness.cb_combusiness where cid > '{$id}' order by cid asc limit 100");
if (empty($mysqlRs)) {
exit("所有數據處理完畢\n");
}
foreach ($mysqlRs as $value) {
$id = $value["cid"];
echo getComUrl($value["cid"], $value["province"]);
writeRMQ("v3cb", "hy", $id);
echo $id, "\n";
}
}
function getComUrl($cid, $pid)
{
return "http://company.gongchang.com/p-{$pid}/{$cid}_" . getCombusAuth($cid) . '/';
}
function getCombusAuth($cid)