/** * 遍历企业信息查询产品打入队列 */ public function runAction() { $cid = 0; while (1) { $comMysql = Gccompany::find(array("conditions" => "cid > ?1", "bind" => array(1 => $cid), "columns" => "cid, state", "limit" => 100, "order" => "cid asc")); $comMysqlRs = $comMysql->toArray(); if (empty($comMysqlRs)) { exit("所有企业信息过滤完毕\n"); } foreach ($comMysqlRs as $value) { $cid = $value["cid"]; if ($value["state"] != 1) { echo "=============" . $cid . "企业状态不正常============\n"; continue; } $this->speAction($cid); } } }
/** * 王兰兰--标记供应商的运营活动,随机出来50条供应商信息 * @param integer $cidStart [description] * @return [type] [description] */ public function getComInfo($cidStart = 0) { $cid = intval($cidStart); $res = array(); $params = array('conditions' => 'cid>=:cid: and cbcid != 0 and state=1', 'bind' => array('cid' => $cid), 'limit' => 50); $result = Gccompany::find($params); if (is_object($result)) { $resTmp = $result->toArray(); foreach ($resTmp as $key => $value) { $res[] = $value['cbcid']; } } return $this->outputData($res); }