本文整理汇总了PHP中DB::field方法的典型用法代码示例。如果您正苦于以下问题:PHP DB::field方法的具体用法?PHP DB::field怎么用?PHP DB::field使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DB
的用法示例。
在下文中一共展示了DB::field方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update_by_id_username
public function update_by_id_username($id, $data, $username, $adminid = 1)
{
if (($id = dintval($id, true)) && $data && is_array($data)) {
$adminid = dintval($adminid);
DB::update($this->_table, $data, DB::field($this->_pk, $id) . " AND ('{$adminid}'=1 OR " . DB::field('author', $username) . ')', true);
}
}
示例2: count_by_access
public function count_by_access($access)
{
if (!is_numeric($access) && !is_array($access)) {
return 0;
}
return DB::result_first('SELECT COUNT(*) FROM %t WHERE ' . DB::field('access', $access), array($this->_table));
}
示例3: delete_by_touid
public function delete_by_touid($touids)
{
if (empty($touids)) {
return false;
}
return DB::query('DELETE FROM mc, mq USING %t AS mc, %t AS mq WHERE mc.' . DB::field('touid', $touids) . ' AND mc.cid=mq.cid', array($this->_table, 'common_mailqueue'), false, true);
}
示例4: delete_by_pid
public function delete_by_pid($pids)
{
if (empty($pids)) {
return false;
}
return DB::query('DELETE FROM %t WHERE ' . DB::field('pid', $pids), array($this->_table), false, true);
}
示例5: delete
public function delete($id, $uid = 0)
{
if (empty($id)) {
return false;
}
return DB::query('DELETE FROM %t WHERE ' . DB::field('id', $id) . ' %i', array($this->_table, $uid ? ' AND ' . DB::field('uid', $uid) : ''));
}
示例6: delete_by_tid
public function delete_by_tid($tids)
{
if (!$tids) {
return;
}
return DB::delete($this->_table, DB::field('tid', $tids));
}
示例7: delete_by_identifier
public function delete_by_identifier($identifier)
{
if (!$identifier) {
return;
}
DB::delete('common_plugin', DB::field('identifier', $identifier));
}
示例8: fetch_all_by_uid
public function fetch_all_by_uid($uid, $new, $type, $start, $perpage)
{
$new = intval($new);
$type = $type ? ' AND ' . DB::field('type', $type) : '';
$new = ' AND ' . DB::field('new', $new);
return DB::fetch_all("SELECT * FROM %t WHERE uid=%d %i %i ORDER BY new DESC, dateline DESC %i", array($this->_table, $uid, $type, $new, DB::limit($start, $perpage)));
}
示例9: fetch_all_by_name
public function fetch_all_by_name($name)
{
if (!empty($name)) {
return DB::fetch_all('SELECT * FROM %t WHERE ' . DB::field('name', $name), array($this->_table));
}
return array();
}
示例10: fetch_all_by_doid
public function fetch_all_by_doid($doids)
{
if (empty($doids)) {
return array();
}
return DB::fetch_all('SELECT * FROM %t WHERE ' . DB::field('doid', $doids) . ' ORDER BY dateline', array($this->_table));
}
示例11: delete_by_dateline
public function delete_by_dateline($dateline)
{
if (!is_numeric($dateline)) {
return false;
}
return DB::delete($this->_table, DB::field('dateline', $dateline, '<='));
}
示例12: update_by_scriptname
public function update_by_scriptname($scriptname, $data)
{
if (!$data || !is_array($data)) {
return;
}
DB::update($this->_table, $data, DB::field('scriptname', $scriptname));
}
示例13: update_by_typeid
public function update_by_typeid($typeid, $data)
{
if (($typeid = dintval($typeid, true)) && !empty($data) && is_array($data)) {
return DB::update($this->_table, $data, DB::field('typeid', $typeid));
}
return false;
}
示例14: delete
public function delete($id) {
if(!$id) {
return "学院删除失败,id为空!";
}
DB::delete($this->_table, DB::field('id', $id));
return "学院删除成功!";
}
示例15: update
public function update($ctid, $uid, $data, $unbuffered = false, $low_priority = false)
{
if (!empty($data) && is_array($data) && $ctid && $uid) {
return DB::update($this->_table, $data, DB::field('ctid', $ctid) . ' AND ' . DB::field('uid', $uid), $unbuffered, $low_priority);
}
return !$unbuffered ? 0 : false;
}