本文整理汇总了PHP中dbeav_model::save方法的典型用法代码示例。如果您正苦于以下问题:PHP dbeav_model::save方法的具体用法?PHP dbeav_model::save怎么用?PHP dbeav_model::save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dbeav_model
的用法示例。
在下文中一共展示了dbeav_model::save方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
function save(&$sdf, $mustUpdate = null)
{
if (isset($sdf['member_id']) && !isset($sdf['pam_account']['account_id'])) {
$sdf['pam_account']['account_id'] = $sdf['member_id'];
}
if (isset($sdf['profile']['gender'])) {
if ($sdf['profile']['gender'] == 'male') {
$sdf['profile']['gender'] = 1;
} elseif ($sdf['profile']['gender'] == 'female') {
$sdf['profile']['gender'] = 0;
} else {
unset($sdf['profile']['gender']);
}
}
if (isset($sdf['profile']['birthday'])) {
$data = explode('-', $sdf['profile']['birthday']);
$sdf['b_year'] = intval($data[0]);
$sdf['b_month'] = intval($data[1]);
$sdf['b_day'] = intval($data[2]);
unset($sdf['profile']['birthday']);
}
$sdf['contact']['addr'] = htmlspecialchars($sdf['contact']['addr']);
parent::save($sdf);
return true;
}
示例2: 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;
}
示例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
function save(&$sdf, $mustUpdate = null)
{
if (isset($sdf['member_id']) && !isset($sdf['pam_account']['account_id'])) {
$sdf['pam_account']['account_id'] = $sdf['member_id'];
}
if (isset($sdf['profile']['gender'])) {
if ($sdf['profile']['gender'] == 'male') {
$sdf['profile']['gender'] = 1;
} elseif ($sdf['profile']['gender'] == 'female') {
$sdf['profile']['gender'] = 0;
} else {
unset($sdf['profile']['gender']);
}
}
if (isset($sdf['profile']['birthday']) && $sdf['profile']['birthday']) {
$data = explode('-', $sdf['profile']['birthday']);
$sdf['b_year'] = intval($data[0]);
$sdf['b_month'] = intval($data[1]);
$sdf['b_day'] = intval($data[2]);
unset($sdf['profile']['birthday']);
}
$sdf['contact']['addr'] = htmlspecialchars($sdf['contact']['addr']);
$info_object = kernel::service('sensitive_information');
if (is_object($info_object)) {
$info_object->opinfo($sdf, 'b2c_mdl_members', __FUNCTION__);
}
parent::save($sdf);
#$this->save_member_info_kv($sdf['member_id']);
return true;
}
示例5: 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;
}
示例6: save
public function save(&$data, $mustUpdate = null, $mustInsert = false)
{
if ($data['content']) {
$data['content'] = base64_encode($data['content']);
}
return parent::save($data, $mustUpdate);
}
示例7: 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);
}
示例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: 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;
}
示例10: save
function save(&$sdf, $mustUpdate = null, $mustInsert = false)
{
if (!isset($sdf['orders'])) {
$sdf['orders'] = array(array('order_id' => $sdf['order_id'], 'items' => $sdf['delivery_items']));
}
$tmpvar = $sdf['orders'];
foreach ($tmpvar as $k => $row) {
$sdf['orders'][$k]['dlytype'] = 'delivery';
$sdf['orders'][$k]['dly_id'] = $sdf['delivery_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'],'*',array('order_items'=>'*'));
if($sdf_order['ship_status'] == 1){
continue;
}
//todo 订单是否完全退货
$data['ship_status'] = 1;
$data['order_id'] = $sdf['order_id'];
$filter['order_id'] = $sdf['order_id'];
$orders = $this->app->model('orders');
$orders->update($data, $filter);
}
}*/
return true;
}
return false;
}
示例11: save
function save(&$data, $mustUpdate = null, $mustInsert = false)
{
if ($data['custom'] == 'false') {
return true;
}
parent::save($data, $mustUpdate);
}
示例12: save
public function save(&$sdf, $mustUpdate = null, $mustInsert = false)
{
if (isset($sdf['profile']['gender'])) {
if ($sdf['profile']['gender'] === 'male') {
$sdf['profile']['gender'] = 1;
} elseif ($sdf['profile']['gender'] === 'female') {
$sdf['profile']['gender'] = 0;
} else {
unset($sdf['profile']['gender']);
}
}
if (isset($sdf['profile']['birthday']) && $sdf['profile']['birthday']) {
$data = explode('-', $sdf['profile']['birthday']);
$sdf['b_year'] = intval($data[0]);
$sdf['b_month'] = intval($data[1]);
$sdf['b_day'] = intval($data[2]);
unset($sdf['profile']['birthday']);
}
$sdf['contact']['addr'] = htmlspecialchars($sdf['contact']['addr']);
if (empty($sdf['member_lv']) || empty($sdf['member_lv']['member_group_id'])) {
$sdf['member_lv']['member_group_id'] = $this->app->model('member_lv')->get_default_lv();
}
$info_object = vmc::service('sensitive_information');
if (is_object($info_object)) {
$info_object->opinfo($sdf, 'b2c_mdl_members', __FUNCTION__);
}
$flag = parent::save($sdf, $mustUpdate, $mustInsert);
return $flag;
}
示例13: save
public function save(&$sdf, $mustUpdate = null, $mustInsert = false)
{
if (!$sdf['comment_id']) {
$sdf['comment_id'] = $this->apply_id($sdf['comment_type'] ? $sdf['comment_type'] : 'comment');
}
$is_save = parent::save($sdf, $mustUpdate, $mustInsert);
return $is_save;
}
示例14: 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);
}
示例15: save
/**
* 重载订单标准数据
* @params array - standard data format
* @params boolean 是否必须强制保存
*/
public function save(&$sdf, $mustUpdate = null, $mustInsert = false)
{
$info_object = vmc::service('sensitive_information');
if (is_object($info_object)) {
$info_object->opinfo($sdf, 'b2c_mdl_orders', __FUNCTION__);
}
$is_save = parent::save($sdf, $mustUpdate, $mustInsert);
return $is_save;
}