本文整理汇总了PHP中dao::geterror方法的典型用法代码示例。如果您正苦于以下问题:PHP dao::geterror方法的具体用法?PHP dao::geterror怎么用?PHP dao::geterror使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dao
的用法示例。
在下文中一共展示了dao::geterror方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: admin
/**
* Block Admin Page.
*
* @param int $index
* @param string $blockID
* @access public
* @return void
*/
public function admin($index = 0, $blockID = '')
{
$this->app->loadLang('block', 'sys');
$title = $index == 0 ? $this->lang->block->createBlock : $this->lang->block->editBlock;
if (!$index) {
$index = $this->block->getLastKey('team') + 1;
}
if ($_POST) {
$this->block->save($index, 'system', 'team');
if (dao::isError()) {
$this->send(array('result' => 'fail', 'message' => dao::geterror()));
}
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->server->http_referer));
}
$block = $this->block->getBlock($index, 'team');
$blockID = $blockID ? $blockID : ($block ? $block->block : '');
$blocks = json_decode($this->block->getAvailableBlocks(), true);
$this->view->blocks = array_merge(array(''), $blocks);
$this->view->title = $title;
$this->view->params = $blockID ? json_decode($this->block->{'get' . ucfirst($blockID) . 'Params'}(), true) : array();
$this->view->blockID = $blockID;
$this->view->block = $block;
$this->view->index = $index;
$this->display();
}
示例2: set
/**
* Set params when type is rss or html.
*
* @param int $index
* @param string $type
* @param int $blockID
* @access public
* @return void
*/
public function set($index, $type, $blockID = 0)
{
if ($_POST) {
$this->block->save($index, $type, 'sys', $blockID);
if (dao::isError()) {
$this->send(array('result' => 'fail', 'message' => dao::geterror()));
}
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('index')));
}
$block = $blockID ? $this->block->getByID($blockID) : $this->block->getBlock($index);
if ($block) {
$type = $block->block;
}
$this->view->type = $type;
$this->view->index = $index;
$this->view->blockID = $blockID;
$this->view->block = $block ? $block : array();
$this->display();
}
示例3: save
/**
* Save tags.
*
* @param string $tags
* @access public
* @return void
*/
public function save($tags)
{
$tags = array_unique(explode(',', $tags));
foreach ($tags as $tag) {
if (trim($tag) == '') {
continue;
}
$rank = $this->countRank($tag);
$count = $this->dao->select('count(*) as count')->from(TABLE_TAG)->where('tag')->eq($tag)->fetch('count');
if ($count == 0) {
$this->dao->insert(TABLE_TAG)->data(array('tag' => $tag, 'rank' => $rank))->exec();
} else {
$this->dao->update(TABLE_TAG)->set('rank')->eq($rank)->where('tag')->eq($tag)->exec();
}
}
if (!dao::isError()) {
return true;
}
return dao::geterror();
}
示例4: finish
/**
* setStatus
*
* @param string $orderID
* @access public
* @return void
*/
public function finish($orderID)
{
$order = $this->order->getByID($orderID);
if ($order->status == 'finished') {
die($this->lang->order->statusList[$order->status]);
}
if ($order->payStatus != 'paid') {
die($this->lang->order->statusList[$order->payStatus]);
}
if ($order->deliveryStatus == 'not_send') {
die($this->lang->order->statusList[$order->deliveryStatus]);
}
$result = $this->order->finish($orderID);
if ($result) {
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess));
}
$this->send(array('result' => 'fail', 'message' => dao::geterror()));
}
示例5: addBlacklist
/**
* Add a blacklist item.
*
* @access public
* @return void
*/
public function addBlacklist()
{
$typeList = $this->lang->guarder->blacklistModes;
if ($_POST) {
$item = $this->post->identity;
$type = 'keywords';
if (validater::checkIP($item)) {
$type = 'ip';
}
if (validater::checkEmail($item)) {
$type = 'email';
}
if (validater::checkAccount($item)) {
$user = $this->loadModel('user')->getByAccount($item);
if (!empty($user)) {
$type = 'account';
}
}
$result = $this->guarder->punish($type, $item, $this->post->reason, $this->post->expired);
if ($result) {
$this->send(array('result' => 'success', 'message' => $this->lang->setSuccess, 'locate' => inlink('blacklist', "mode={$type}")));
}
$this->send(array('result' => 'fail', 'message' => dao::geterror()));
}
$this->view->title = $this->lang->guarder->addBlacklist;
$this->display();
}
示例6: edit
/**
* Edit auth.
*
* @param string $code
* @access public
* @return void
*/
public function edit($code)
{
if (!empty($_POST)) {
if (!$this->post->buildin and strpos($this->post->login, '/') !== 0 and !preg_match('/https?\\:\\/\\//Ui', $this->post->login)) {
$this->send(array('result' => 'fail', 'message' => $this->lang->entry->error->url));
}
$this->entry->update($code);
if (dao::isError()) {
$this->send(array('result' => 'fail', 'message' => dao::geterror()));
}
$this->send(array('result' => 'success', 'locate' => inlink('admin'), 'entries' => $this->entry->getJSONEntries()));
}
$entry = $this->entry->getByCode($code);
if ($entry->size != 'max') {
$size = json_decode($entry->size);
$entry->size = 'custom';
$entry->width = $size->width;
$entry->height = $size->height;
}
$this->view->title = $this->lang->entry->common . $this->lang->colon . $this->lang->entry->edit;
$this->view->entry = $entry;
$this->view->code = $code;
$this->display();
}