public static function &getInstance() { if (self::$_instance === null) { self::$_instance = new self(); } return self::$_instance; }
public function getTasks() { $condition = array(array('id', '>', $this->lastLogId), array('cityId', 'in', $this->cities), array('dateIndex', '=', $this->returnDay), array('status', 'in', array(6, 7, 4))); $sort = array('id', 'asc'); if ($this->_dataBase == Const_ShowcaseOrders::SALE_DB) { $tasks = Model_Broker_AdConsumeSaleLog::getList(date('Ym', strtotime($this->returnDay)), $condition, $this->limit, $sort); } else { $tasks = Model_Broker_AdConsumeRentLog::getList(date('Ym', strtotime($this->returnDay)), $condition, $this->limit, $sort); } return $tasks; }
public function updateConsumeInfo($dateIndex, $data, $keyData, $type) { $tableYearMonth = date('Ym', strtotime($dateIndex)); if ($type == Const_ShowcaseOrders::SALE_DB) { $tmp = Model_Broker_AdConsumeSaleLog::getInstance()->updateConsumeInfo($data, $keyData, $tableYearMonth); if ($tmp) { $res = array('status' => true); } else { $res = array('status' => false); } } elseif ($type == Const_ShowcaseOrders::RENT_DB) { $tmp = Model_Broker_AdConsumeRentLog::getInstance()->updateConsumeInfo($data, $keyData, $tableYearMonth); if ($tmp) { $res = array('status' => true); } else { $res = array('status' => false); } } else { $res = array('status' => false); } return $res; }