本文整理汇总了PHP中dbeav_model类的典型用法代码示例。如果您正苦于以下问题:PHP dbeav_model类的具体用法?PHP dbeav_model怎么用?PHP dbeav_model使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了dbeav_model类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
function save(&$sdf, $mustUpdate = null)
{
if (!isset($sdf['orders'])) {
$sdf['orders'] = array(array('order_id' => $sdf['order_id'], 'items' => $sdf['items']));
}
$tmpvar = $sdf['orders'];
foreach ($tmpvar as $k => $row) {
$sdf['orders'][$k]['dlytype'] = 'reship';
$sdf['orders'][$k]['dly_id'] = $sdf['reship_id'];
}
unset($tmpvar);
if (parent::save($sdf)) {
//一张发货单多个订单
$oOrder =& $this->app->model('orders');
foreach ($sdf['orders'] as $order) {
if ($sdf['order_id']) {
$sdf_order = $oOrder->dump($order['order_id']);
if ($sdf_order['ship_status'] == 5) {
continue;
}
//todo 订单是否完全发货
$data['ship_status'] = 4;
$data['order_id'] = $sdf['order_id'];
$filter['order_id'] = $sdf['order_id'];
$orders =& $this->app->model('orders');
$orders->update($data, $filter);
}
}
}
return true;
}
示例2:
function __construct($app)
{
parent::__construct($app);
$db = app::get('system')->database();
$db->exec('set SESSION autocommit=1;');
$db->exec('set @msgID = -1;');
}
示例3: _filter
public function _filter($filter, $tableAlias = null, $baseWhere = null)
{
if (is_array($filter) && $filter['login_account']) {
$tmpfilter['login_account'] = $filter['login_account'];
unset($filter['login_account']);
}
if (is_array($filter) && $filter['email']) {
$tmpfilter['email'] = $filter['email'];
unset($filter['email']);
}
if (is_array($filter) && $filter['mobile']) {
$tmpfilter['mobile'] = $filter['mobile'];
unset($filter['mobile']);
}
if (is_array($filter) && $tmpfilter) {
$aData = app::get('sysuser')->model('account')->getList('user_id', $tmpfilter);
if ($aData) {
foreach ($aData as $key => $val) {
$user[$key] = $val['user_id'];
}
$filter['user_id'] = $user;
} else {
$filter['user_id'] = '-1';
}
}
$filter = parent::_filter($filter);
return $filter;
}
示例4: save
public function save(&$data, $mustUpdate = null, $mustInsert = false)
{
if ($data['area_fee_conf'] && is_array($data['area_fee_conf'])) {
}
$return = parent::save($data, $mustUpdate);
return $return;
}
示例5: save
function save(&$data, $mustUpdate = null, $mustInsert = false)
{
if ($data['custom'] == 'false') {
return true;
}
parent::save($data, $mustUpdate);
}
示例6: save
function save(&$data, $mustUpdate = null)
{
if ($data['area']) {
$data['area'] = $data['area']['area_type'] . ':' . implode('/', $data['area']['sar']) . ':' . $data['area']['id'];
}
return parent::save($data, $mustUpdate);
}
示例7: getList
/**
* 重写getList方法
* @param string column
* @param array filter
* @param int offset
* @param int limit
* @param string order by
*/
public function getList($cols = '*', $filter = array(), $offset = 0, $limit = -1, $orderType = null)
{
$recycle_permission = $filter['recycle_permission'];
unset($filter['recycle_permission']);
if ($recycle_permission && is_array($recycle_permission)) {
if (strpos($cols, 'permission') === false) {
$cols .= ',permission ';
}
}
$ids = array();
$res = app::get('base')->model('apps')->getList('app_id', array('status' => 'active'));
foreach ($res as $res_v) {
$ids[] = $res_v['app_id'];
}
$filter['app_key|in'] = $ids;
$data = parent::getList($cols, $filter, $offset, $limit, $orderType);
if ($recycle_permission && is_array($recycle_permission)) {
$aTmp = array();
$menus = $this->app->model('menus');
$recycle = $this->app->model('recycle');
foreach ($data as $k => $v) {
$per_row = $menus->getList('menu_id', array('menu_type' => 'permission', 'permission' => $v['permission']));
if (!$per_row || in_array($v['permission'], $recycle_permission)) {
$aTmp[$k] = $v;
}
}
return $aTmp;
} else {
return $data;
}
}
示例8: save
/**
* 保存的方法
* @param mixed 保存的数据内容
* @return boolean
*/
public function save(&$aData, $mustUpdate = null, $mustInsert = false)
{
$path = array();
$parent_id = $aData['parent_id'];
while ($parent_id) {
if ($aData['cat_id'] && $aData['cat_id'] == $parent_id) {
return false;
break;
}
array_unshift($path, $parent_id);
$row = $this->dump(array('cat_id' => $parent_id), 'parent_id, cat_path, p_order');
$parent_id = $row['parent_id'];
}
$olddata = $this->getList('*', array('cat_id' => $aData['cat_id']));
if ($olddata[0]['parent_id'] && $olddata[0]['parent_id'] != $aData['parent_id']) {
$row = $this->getList('*', array('cat_id' => $olddata[0]['parent_id']));
$oldSave['cat_id'] = $row[0]['cat_id'];
$oldSave['child_count'] = $row[0]['child_count'] - 1;
parent::save($oldSave);
}
$aData['cat_path'] = $this->getCatPath($aData['parent_id']);
if ($aData['parent_id'] != 0) {
$row = parent::dump($aData['parent_id']);
$data['child_count'] = $row['child_count'] + 1;
$data['cat_id'] = $aData['parent_id'];
parent::save($data);
}
parent::save($aData);
return $this->cat2json();
}
示例9: getDetail
/**
* 获得商店详情
*
* @param array $param 参数
* @param number $update_visit 是否更新访问,1->更新(默认), 其它 -> 不更新
* @return array
*/
function getDetail($param = array(), $update_visit = 1)
{
$info = array();
$shop_id = $param['shop_id'] ? $param['shop_id'] : 0;
$member_id = $param['member_id'] ? $param['member_id'] : 0;
if ($shop_id > 0 || $member_id > 0) {
if ($shop_id) {
$filter['shop_id'] = $param['shop_id'];
}
if ($member_id) {
$filter['member_id'] = $param['member_id'];
}
$info = parent::dump($filter);
// 添加商品访问
if ($info['is_open'] == 1) {
if ($update_visit == 1) {
$_info = array('see_num' => $info['see_num'] + 1);
parent::update($_info, array('shop_id' => $info['shop_id']));
}
$_param = array('app' => 'microshop', 'ctl' => 'site_index', 'full' => 1, 'act' => 'detail', 'arg0' => $info['shop_id']);
$info['shop_link'] = app::get('site')->router()->gen_url($_param);
$m_mdl = app::get('b2c')->model('members');
$m_info = $m_mdl->dump($info['member_id']);
$info['follow_num'] = $m_info['follow_num'];
$info['fans_num'] = $m_info['follow_num'];
$info['cover'] = $m_info['cover'] ? kernel::single('base_storager')->image_path($m_info['cover']) : $this->app->res_url . '/images/top-bg.png';
$info['avatar'] = $m_info['avatar'] ? kernel::single('base_storager')->image_path($m_info['avatar']) : $this->app->res_url . '/images/top-bg.png';
$info['info'] = $m_info['info'];
}
}
return $info;
}
示例10: _filter
public function _filter($filter, $tableAlias = null, $baseWhere = null)
{
if (is_array($filter) && $filter['shop_name']) {
$objMdlShop = app::get('sysshop')->model('shop');
$adata = $objMdlShop->getList('shop_id', array('shop_name|has' => $filter['shop_name']));
if ($adata) {
foreach ($adata as $key => $value) {
$shop[$key] = $value['shop_id'];
}
$filter['shop_id'] = $shop;
} else {
$filter['shop_id'] = "-1";
}
unset($filter['shop_name']);
}
if (is_array($filter) && $filter['login_account']) {
$aData = app::get('sysuser')->model('account')->getList('user_id', array('login_account' => $filter['login_account']));
if ($aData) {
foreach ($aData as $key => $val) {
$user[$key] = $val['user_id'];
}
$filter['user_id'] = $user;
} else {
$filter['user_id'] = '-1';
}
unset($filter['login_account']);
}
$filter = parent::_filter($filter, $tableAlias, $baseWhere);
return $filter;
}
示例11: update
public function update($params, $filter)
{
$params = $this->valid_update($params);
if (!$params) {
return false;
}
return parent::update($params, $filter);
}
示例12: dump
function dump($filter, $field = '*', $subSdf = null)
{
if ($ret = parent::dump($filter, $field, $subSdf)) {
$ret['profile']['birthday'] = $ret['b_year'] . '-' . $ret['b_month'] . '-' . $ret['b_day'];
$ret['profile']['gender'] = $ret['profile']['gender'] == 1 ? 'male' : 'female';
}
return $ret;
}
示例13: _filter
public function _filter($filter, $tableAlias = null, $baseWhere = null)
{
if (is_array($filter) && !$filter['disabled']) {
$filter['disabled'] = 0;
}
$filter = parent::_filter($filter, $tableAlias, $baseWhere);
return $filter;
}
示例14: getList
public function getList($cols = '*', $filter = 'null', $offset = 0, $limit = -1, $orderby = null)
{
$list = parent::getList($cols, $filter, $offset, $limit, $orderby);
foreach ($list as $key => $row) {
$list[$key]['content'] = base64_decode($row['content']);
}
return $list;
}
示例15: save
function save(&$item)
{
$list = parent::getList('*', array('tag_name' => $item['tag_name'], 'tag_type' => $item['tag_type'], 'app_id' => $item['app_id']));
if ($list && count($list) > 0) {
$item['tag_id'] = $list[0]['tag_id'];
}
parent::save($item);
}