本文整理汇总了PHP中dbeav_model::dump方法的典型用法代码示例。如果您正苦于以下问题:PHP dbeav_model::dump方法的具体用法?PHP dbeav_model::dump怎么用?PHP dbeav_model::dump使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dbeav_model
的用法示例。
在下文中一共展示了dbeav_model::dump方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
/**
* 模板统一保存的方法
* @params array - 需要保存的支付信息
* @params boolean - 是否需要强制保存
* @return boolean - 保存的成功与否的进程
*/
public function save(&$data, $mustUpdate = NULL, $mustInsert = false)
{
// 异常处理
if (!isset($data) || !$data || !is_array($data)) {
trigger_error(app::get('ectools')->_("支付单信息不能为空!"), E_USER_ERROR);
exit;
}
$sdf = array();
// 支付数据列表
$background = true;
//后台 todo
$payment_data = $data;
$sdf_payment = parent::dump($data['refund_id'], '*');
if ($sdf_payment) {
if ($sdf_payment['status'] == $data['status'] || $sdf_payment['status'] != 'progress' && $sdf_payment['status'] != 'ready') {
return true;
}
if ($data['currency'] && $sdf_payment['currency'] != $data['currency']) {
return false;
}
}
if ($sdf_payment) {
$sdf = array_merge($sdf_payment, $data);
} else {
$sdf = $data;
//$sdf['status'] = 'ready';
}
// 保存支付信息(可能是退款信息)
$is_succ = parent::save($sdf);
return $is_succ;
}
示例2: save
/**
* 模板统一保存的方法
* @params array - 需要保存的支付信息
* @params boolean - 是否需要强制保存
* @return boolean - 保存的成功与否的进程
*/
public function save($data, $mustUpdate = null)
{
// 异常处理
if (!isset($data) || !$data || !is_array($data)) {
trigger_error("支付单信息不能为空!", E_USER_ERROR);
exit;
}
$sdf = array();
// 支付数据列表
$background = true;
//后台 todo
$payment_data = $data;
$sdf_payment = parent::dump($data['payment_id'], '*');
if ($sdf_payment) {
if ($sdf_payment['status'] == $data['status'] || $sdf_payment['status'] != 'progress' && $sdf_payment['status'] != 'ready') {
return true;
}
if ($data['currency'] && $sdf_payment['currency'] != $data['currency']) {
$msg = __('#支付货币和订单货币不一致');
return false;
}
}
if ($sdf_payment) {
$sdf = array_merge($sdf_payment, $data);
} else {
$sdf = $data;
$sdf['status'] = $sdf['status'] ? $sdf['status'] : 'ready';
}
// 保存支付信息(可能是退款信息)
$is_succ = parent::save($sdf);
return $is_succ;
}
示例3: save
/**
* 模板统一保存的方法
* @params array - 需要保存的支付信息
* @params boolean - 是否需要强制保存
* @return boolean - 保存的成功与否的进程
*/
public function save(&$data, $mustUpdate = null, $mustInsert = false)
{
// 异常处理
if (!isset($data) || !$data || !is_array($data)) {
trigger_error(app::get('ectools')->_("支付单信息不能为空!"), E_USER_ERROR);
exit;
}
$sdf = array();
// 支付数据列表
$background = true;
//后台 todo
$payment_data = $data;
$sdf_payment = parent::dump($data['payment_id'], '*', 'default');
if ($sdf_payment) {
if ($data['orders'][0]['rel_id'] && key($sdf_payment['orders']) != $data['orders'][0]['rel_id']) {
return false;
}
if ($sdf_payment['status'] == $data['status'] || $sdf_payment['status'] != 'progress' && $sdf_payment['status'] != 'ready') {
return true;
}
if ($data['currency'] && $sdf_payment['currency'] != $data['currency']) {
return false;
}
}
$sdf = $data;
$sdf['status'] = $sdf['status'] ? $sdf['status'] : 'ready';
// 保存支付信息(可能是退款信息)
$is_succ = parent::save($sdf, $mustUpdate, $mustInsert);
return $is_succ;
}
示例4: 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();
}
示例5: dump
function dump($filter, $field = '*', $subSdf = null)
{
$dumpData = parent::dump($filter, $field, $subSdf);
//剔除非商品图片
if (isset($dumpData['images']) && $dumpData['images']) {
foreach ($dumpData['images'] as $key => $value) {
if ($value['target_type'] != "goods") {
unset($dumpData['images'][$key]);
}
}
}
$oSpec = $this->app->model('specification');
if ($dumpData['spec_desc'] && is_array($dumpData['spec_desc'])) {
foreach ($dumpData['spec_desc'] as $specId => $spec) {
$dumpData['spec'][$specId] = $oSpec->dump($specId, '*');
foreach ($spec as $pSpecId => $specValue) {
$dumpData['spec'][$specId]['option'][$pSpecId] = array_merge(array('private_spec_value_id' => $pSpecId), $specValue);
}
}
}
unset($dumpData['spec_desc']);
if ($dumpData['product']) {
$aProduct = current($dumpData['product']);
if (isset($aProduct['price']['price']['current_price'])) {
$dumpData['current_price'] = $aProduct['price']['price']['current_price'];
}
} else {
if ($dumpData['price']) {
$dumpData['current_price'] = $dumpData['price'];
}
}
return $dumpData;
}
示例6: 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;
}
示例7: dump
function dump($filter, $field = '*', $subSdf = null)
{
$dumpData =& parent::dump($filter, $field, $subSdf);
$oSpec =& $this->app->model('specification');
if ($dumpData['spec_desc'] && is_array($dumpData['spec_desc'])) {
foreach ($dumpData['spec_desc'] as $specId => $spec) {
$dumpData['spec'][$specId] = $oSpec->dump($specId, '*');
foreach ($spec as $pSpecId => $specValue) {
$dumpData['spec'][$specId]['option'][$pSpecId] = array_merge(array('private_spec_value_id' => $pSpecId), $specValue);
}
}
}
unset($dumpData['spec_desc']);
if ($dumpData['product']) {
$aProduct = current($dumpData['product']);
if (isset($aProduct['price']['price']['current_price'])) {
$dumpData['current_price'] = $aProduct['price']['price']['current_price'];
}
} else {
if ($dumpData['price']) {
$dumpData['current_price'] = $dumpData['price'];
}
}
return $dumpData;
}
示例8: 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;
}
示例9: dump
function dump($filter, $field = '*', $subSdf = null)
{
$dumpData =& parent::dump($filter, $field, $subSdf);
$obj_themes_file = app::get('site')->model('themes_file');
if ($dumpData['rel_file_id']) {
$themes_file_content = $obj_themes_file->getList('content', array('id' => $dumpData['rel_file_id']));
$dumpData['content'] = $themes_file_content['0']['content'];
}
return $dumpData;
}
示例10: save
function save($aData)
{
$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);
}
return parent::save($aData);
}
示例11: dump
function dump($filter, $field = '*', $subSdf = null)
{
$rs = parent::dump($filter, $field, $subSdf);
$oMlv = $this->app->model('member_lv');
$memLv = $oMlv->dump($filter['level_id']);
$price = $this->db->selectrow('SELECT price FROM sdb_b2c_products WHERE product_id = ' . intval($filter['product_id']));
$price = $price['price'];
if ($rs) {
$rs['title'] = $memLv['name'];
$rs['custom'] = 'true';
} else {
$rs = array('level_id' => $filter['level_id'], 'price' => $memLv['dis_count'] > 0 ? $memLv['dis_count'] * $price : $price, 'title' => $memLv['name'], 'custom' => 'false');
}
return $rs;
}
示例12: dump
function dump($filter, $field = '*', $subSdf = null)
{
$rs = parent::dump($filter, $field, $subSdf);
$oMlv =& $this->app->model('member_lv');
$oPro =& $this->app->model('products');
$memLv = $oMlv->dump($filter['level_id']);
$price = $oPro->dump($filter['product_id'], 'price');
$price = $price['price']['price']['price'];
if ($rs) {
$rs['title'] = $memLv['name'];
$rs['custom'] = 'true';
} else {
$rs = array('level_id' => $filter['level_id'], 'price' => $memLv['dis_count'] > 0 ? $memLv['dis_count'] * $price : $price, 'title' => $memLv['name'], 'custom' => 'false');
}
return $rs;
}
示例13: dump
function dump($filter, $field = '*', $subSdf = null)
{
$data = parent::dump($filter, $field, $subSdf);
if (!isset($this->site_member_lv_id)) {
$ctlGoods = new b2c_ctl_site_product($this->app);
$siteMember = $ctlGoods->get_current_member();
$this->site_member_lv_id = $siteMember['member_lv'];
}
if (isset($data['price']) && $data['price'] && is_array($data['price']) && isset($data['price']['member_lv_price']) && $data['price']['member_lv_price'] && is_array($data['price']['member_lv_price'])) {
if (array_key_exists('member_lv_price', $data['price']) && array_key_exists($this->site_member_lv_id, $data['price']['member_lv_price'])) {
$data['price']['price']['current_price'] = $data['price']['member_lv_price'][$this->site_member_lv_id]['price'];
} else {
$data['price']['price']['current_price'] = $data['price']['price']['price'];
}
}
return $data;
}
示例14: 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'];
if ($ret['profile']['gender'] == 1) {
$ret['profile']['gender'] = 'male';
} elseif ($ret['profile']['gender'] == 0) {
$ret['profile']['gender'] = 'female';
} else {
$ret['profile']['gender'] = 'no';
}
}
if (intval($filter) == 0 || is_array($filter) && intval($filter['member_id']) == 0) {
$ret['contact']['name'] = "匿名购买";
}
return $ret;
}
示例15: dump
function dump($filter, $field = '*', $subSdf = null)
{
$data = parent::dump($filter, $field, $subSdf);
if (!isset($this->site_member_lv_id)) {
$userObject = kernel::single('b2c_user_object');
$siteMember = $userObject->get_members_data(array('members' => 'member_lv_id'));
$this->site_member_lv_id = $siteMember['members']['member_lv_id'];
}
if (isset($data['price']) && $data['price'] && is_array($data['price']) && isset($data['price']['member_lv_price']) && $data['price']['member_lv_price'] && is_array($data['price']['member_lv_price'])) {
if (array_key_exists('member_lv_price', $data['price']) && array_key_exists($this->site_member_lv_id, $data['price']['member_lv_price'])) {
$data['price']['price']['current_price'] = $data['price']['member_lv_price'][$this->site_member_lv_id]['price'];
} else {
$data['price']['price']['current_price'] = $data['price']['price']['price'];
}
}
return $data;
}