本文整理汇总了PHP中BaseModel::autoCommit方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseModel::autoCommit方法的具体用法?PHP BaseModel::autoCommit怎么用?PHP BaseModel::autoCommit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseModel
的用法示例。
在下文中一共展示了BaseModel::autoCommit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view_addCombineOn
//.........这里部分代码省略.........
$combineNote = $_POST['combineNote' . $index] ? trim($_POST['combineNote' . $index]) : '';
$skuArr = $_POST['sku' . $index];
$countArr = $_POST['count' . $index];
$dataCom = array();
$dataCom['combineSpu'] = $combineSpu;
$dataCom['combineSku'] = $combineSku;
$dataCom['combineCost'] = $combineCost;
$dataCom['combineWeight'] = $combineWeight;
$dataCom['combineLength'] = $combineLength;
$dataCom['combineWidth'] = $combineWidth;
$dataCom['combineHeight'] = $combineHeight;
$dataCom['combineNote'] = $combineNote;
$dataCom['combineUserId'] = $_SESSION['userId'];
$dataCom['addTime'] = time();
$tName = 'pc_goods_combine';
$insertIdCom = OmAvailableModel::addTNameRow2arr($tName, $dataCom);
if (!$insertIdCom) {
throw new Exception('add combine error');
}
$dataRelation = array();
$dataRelationMem = array();
for ($i = 0; $i < count($skuArr); $i++) {
if (!empty($skuArr[$i]) && !empty($countArr[$i])) {
$dataRelation[] = array('combineSku' => $combineSku, 'sku' => $skuArr[$i], 'count' => $countArr[$i]);
$dataRelationMem[] = array('sku' => $skuArr[$i], 'count' => $countArr[$i]);
}
}
if (!empty($dataRelation)) {
$tName = 'pc_sku_combine_relation';
$where = "WHERE combineSku='{$combineSku}'";
$dataRelationCount = OmAvailableModel::getTNameCount($tName, $where);
if ($dataRelationCount) {
OmAvailableModel::deleteTNameRow($tName, $where);
}
foreach ($dataRelation as $value) {
if (!empty($value['combineSku']) && !empty($value['sku']) && !empty($value['count'])) {
$insertId = OmAvailableModel::addTNameRow2arr($tName, $value);
}
}
}
if ($autoSpuList[0]['status'] != 2) {
$tName = 'pc_auto_create_spu';
$set = "SET status=2";
$where = "WHERE spu='{$combineSpu}'";
$affectRow = OmAvailableModel::updateTNameRow($tName, $set, $where);
}
//将新添加的sku添加到mem中
$key = 'pc_goods_combine_' . $combineSku;
$dataCom['detail'] = $dataRelationMem;
$value = $dataCom;
setMemNewByKey($key, $value);
//这里不保证能添加成功
//同步新数据到旧系统中
$ebayProductsCombine = array();
$ebayProductsCombine['id'] = $insertIdCom;
$ebayProductsCombine['goods_sn'] = $combineSku;
$goods_sncombine = array();
$truesku = array();
foreach ($dataRelationMem as $value) {
$str = '';
$strTrue = '';
$str = $value['sku'] . '*' . $value['count'];
$strTrue = '[' . $value['sku'] . ']';
$goods_sncombine[] = $str;
$truesku[] = $strTrue;
}
$ebayProductsCombine['goods_sncombine'] = implode(',', $goods_sncombine);
$ebayProductsCombine['notes'] = $combineNote;
$ebayProductsCombine['goods_price'] = $combineCost;
$ebayProductsCombine['goods_weight'] = $combineWeight;
$ebayProductsCombine['cguser'] = getPersonNameById($_SESSION['userId']);
$ebayProductsCombine['ebay_user'] = 'vipchen';
$ebayProductsCombine['createdtime'] = time();
$ebayProductsCombine['truesku'] = implode(',', $truesku);
$ebayGoodsArr[] = $ebayProductsCombine;
}
BaseModel::commit();
BaseModel::autoCommit();
addSalerInfoForAny($combineSpu, 2, $_SESSION['userId'], $_SESSION['userId']);
//add by zqt 20140519,添加销售人逻辑
//同步数据到深圳ERP
foreach ($ebayGoodsArr as $value) {
$ret = OmAvailableModel::newData2ErpInterfOpen('pc.erp.addGoodsCombine', $value, 'gw88');
}
$status = "添加成功";
echo '<script language="javascript">
alert("' . $status . '");
window.parent.location.href = "index.php?mod=goods&act=getCombineList&searchComField=1&fieldValue=' . $combineSpu . '";
</script>';
exit;
} catch (Exception $e) {
BaseModel::rollback();
BaseModel::autoCommit();
echo $e->getMessage();
$status = "添加失败,请联系系统技术部,谢谢";
echo '<script language="javascript">
alert("' . $status . '");
</script>';
}
}
示例2: act_modifyOrder
//.........这里部分代码省略.........
if (isset($data['countryName'])) {
$update_userinfo['countryName'] = $data['countryName'];
}
if (isset($data['zipCode'])) {
$update_userinfo['zipCode'] = $data['zipCode'];
}
if (isset($data['landline'])) {
$update_userinfo['landline'] = $data['landline'];
}
if (isset($data['phone'])) {
$update_userinfo['phone'] = $data['phone'];
}
if (isset($data['transportId'])) {
$update_order['transportId'] = $data['transportId'];
}
if (isset($data['update_notes'])) {
$update_note = $data['update_notes'];
}
if (isset($data['note_new'])) {
$add_note = $data['note_new'];
}
if ($data['edit_tracknumber']) {
$update_tracknumber['omOrderId'] = $orderid;
$update_tracknumber['tracknumber'] = $data['edit_tracknumber'];
$update_tracknumber['addUser'] = $_SESSION['sysUserId'];
$update_tracknumber['createdTime'] = time();
//var_dump($update_tracknumber); exit;
}
BaseModel::begin();
//开始事务
if ($update_order) {
//$sql = "UPDATE om_unshipped_order set ".array2sql($update_order)." WHERE id = ".$orderid;
//$msg = commonModel::orderLog($orderid,$update_order['orderStatus'],$update_order['orderType'],$sql);
if (OrderindexModel::updateOrder('om_unshipped_order', $update_order, ' WHERE id = ' . $orderid)) {
if ($updatestatus) {
$ProductStatus = new ProductStatus();
if (!$ProductStatus->updateSkuStatusByOrderStatus(array($orderid), $batch_ostatus_val, $batch_otype_val)) {
BaseModel::rollback();
}
}
$modify_showerrorinfo = "<font color='green'>更新成功</font>";
} else {
self::$errCode = "001";
self::$errMsg = "更新订单信息失败!";
BaseModel::rollback();
return false;
}
}
if ($update_userinfo) {
//var_dump($update_userinfo);
if (OrderindexModel::updateOrder('om_unshipped_order_userInfo', $update_userinfo, ' WHERE omOrderId = ' . $orderid)) {
$modify_showerrorinfo = "<font color='green'>更新成功</font>";
} else {
self::$errCode = "002";
self::$errMsg = "更新订单用户信息失败!";
BaseModel::rollback();
return false;
}
}
if ($update_tracknumber) {
//echo $msg;
if (!OrderAddModel::insertOrderTrackRow($update_tracknumber)) {
self::$errCode = "003";
self::$errMsg = "更新订单跟踪号插入失败!";
BaseModel::rollback();
return false;
}
}
if ($update_note) {
foreach ($update_note as $key => $value) {
$notes = explode("###", $value);
$where = " where content='{$notes[0]}' and omOrderId={$orderid}";
$set = "set content='{$notes[1]}',userId={$_SESSION['sysUserId']},createdTime=" . time();
$msg = OmAvailableModel::updateTNameRow("om_order_notes", $set, $where);
if (!$msg) {
self::$errCode = "004";
self::$errMsg = "更新订单备注失败!";
BaseModel::rollback();
return false;
}
}
}
if ($add_note) {
foreach ($add_note as $key => $value) {
$set = "set omOrderId={$orderid},content='{$value}',userId={$_SESSION['sysUserId']},createdTime=" . time();
$msg = OmAvailableModel::insertRow("om_order_notes", $set);
if (!$msg) {
self::$errCode = "005";
self::$errMsg = "插入订单备注失败!";
BaseModel::rollback();
return false;
}
}
}
self::$errCode = "200";
self::$errMsg = "整个订单信息更新成功!";
BaseModel::commit();
BaseModel::autoCommit();
}
}
示例3: act_auditIoStoreInWh
/**
*功能:提供给仓库系统的接口,审核领料单
* */
public function act_auditIoStoreInWh()
{
$ordersn = isset($_GET['ordersn']) ? $_GET['ordersn'] : "";
$isAudit = isset($_GET['isAudit']) ? $_GET['isAudit'] : 0;
$auditorId = isset($_GET['auditorId']) ? $_GET['auditorId'] : 0;
$now = time();
if (intval($auditorId) <= 0) {
self::$errCode = 101;
self::$errMsg = "审核人有误";
return false;
}
if (empty($ordersn)) {
self::$errCode = 102;
self::$errMsg = "单号不能为空!";
return false;
}
if ($isAudit != 2 && $isAudit != 3) {
//isAudit=2为审核通过,3为审核不通过
self::$errCode = 102;
self::$errMsg = "审核状态值有误,只能为通过或不通过";
return false;
}
$tName = 'pc_products_iostore';
$select = '*';
$where = "WHERE is_delete=0 and isAudit=1 and ordersn='{$ordersn}'";
$ioStoreList = OmAvailableModel::getTNameList($tName, $select, $where);
if (empty($ioStoreList)) {
self::$errCode = 103;
self::$errMsg = "该单据号不存在或者已经审核过";
return false;
}
try {
BaseModel::begin();
//$tName = 'pc_products_iostore';
$dataIostore = array();
$dataIostore['isAudit'] = $isAudit;
$dataIostore['auditorId'] = $userId;
$dataIostore['auditTime'] = $now;
OmAvailableModel::updateTNameRow2arr($tName, $dataIostore, $where);
//将表头改为审核状态
$tName = 'pc_products_iostore_detail';
$dataIostoreDetail = array();
$dataIostoreDetail['isAudit'] = $isAudit;
$where = "WHERE is_delete=0 AND iostoreId='{$ioStoreList[0]['id']}'";
OmAvailableModel::updateTNameRow2arr($tName, $dataIostoreDetail, $where);
//将表体的料号(is_delete=0)改为审核状态
//if($ioStoreList[0]['iostoreTypeId'] == 1 && $ioStoreList[0]['useTypeId'] == 1){//如果该单是制作领料单(新品下单的),则要将该单据下的料号加到新品列表去
// $select = 'sku';
// $skuList = OmAvailableModel::getTNameList($tName, $select, $where);
// foreach($skuList as $value){
// $sku = $value['sku'];
// $tName = 'pc_products';
// $dataProducts = array();
// $dataProducts['sku'] = $sku;
// OmAvailableModel::addTNameRow2arr($tName, $dataProducts);//将detail中的sku加入到产品制作表中
// }
// }
if ($ioStoreList[0]['iostoreTypeId'] == 2 && $ioStoreList[0]['useTypeId'] == 1) {
//如果该单是制作退料单,则要将该单中的料号状态改变为已经归还
$select = 'sku';
$skuList = OmAvailableModel::getTNameList($tName, $select, $where);
foreach ($skuList as $value) {
$sku = $value['sku'];
$tName = 'pc_products';
$dataProducts = array();
$dataProducts['productsReturnerId'] = $ioStoreList[0]['addUserId'];
//归还人即该单据的添加人
$dataProducts['productsReturnTime'] = $now;
//归还人即该单据的添加人
$where = "WHERE sku='{$sku}'";
OmAvailableModel::updateTNameRow2arr($tName, $dataProducts, $where);
//将detail中的sku加入到产品制作表中
}
}
BaseModel::commit();
BaseModel::autoCommit();
} catch (Exception $e) {
BaseModel::rollback();
BaseModel::autoCommit();
}
}
示例4: act_updateSkuConversion
//.........这里部分代码省略.........
self::$errMsg = "登陆超时,请重试";
return;
}
$tName = 'pc_sku_conversion';
$select = 'new_sku';
$where = "WHERE id={$id} and is_delete=0";
$skuConNewSkuList = OmAvailableModel::getTNameList($tName, $select, $where);
//在料号转换表中找到id所在记录的新料号new_sku
$skuConNewSku = $skuConNewSkuList[0]['new_sku'];
if (empty($skuConNewSku)) {
self::$errCode = '104';
self::$errMsg = "记录的新料号不存在";
return;
}
if ($skuConNewSku == $new_sku) {
self::$errCode = '111';
self::$errMsg = "修改前后料号相同,无修改";
return;
}
$tName = 'pc_goods';
$select = '*';
$where = "WHERE is_delete=0 AND sku='{$skuConNewSku}'";
$newSkuPcList = OmAvailableModel::getTNameList($tName, $select, $where);
//在产品表里找是否存在未修改前的料号
$newSkuPc = $newSkuPcList[0];
//未修改前的料号信息
if (empty($newSkuPc)) {
self::$errCode = '105';
self::$errMsg = "修改前的料号 {$skuConNewSku} 在产品列表中不存在";
return;
}
$newSkuPcSku = $newSkuPc['sku'];
//$newSkuPcArr = array_filter(explode('_',$newSkuPc));//修改前的sku按照_来截取
// $newSpuPc = $newSkuPcArr[0];//取得新料号的SPU
// $newSkuArr = array_filter(explode('_',$new_sku));//修改后的sku按照_来截取
// $newSpu = $newSkuArr[0];//取得新料号的SPU
// if($newSpuPc != $newSpu){
// self::$errCode = '107';
// self::$errMsg = "修改前后的SPU不符,请检查";
// return;
// }
try {
BaseModel::begin();
$tName = 'pc_sku_conversion';
$set = "SET new_sku='{$new_sku}',modifiedUserId='{$modifiedUserId}',modifiedTime='{$modifiedTime}'";
$where = "WHERE id={$id} and is_delete=0";
OmAvailableModel::updateTNameRow($tName, $set, $where);
//先将转换记录修改
$tName = 'pc_goods';
$set = "SET goodsStatus=101,is_delete=1";
//将未修改前的sku状态改为 料号转化,并delete
$where = "WHERE is_delete=0 and sku='{$newSkuPcSku}'";
OmAvailableModel::updateTNameRow($tName, $set, $where);
$where = "WHERE is_delete=0 and sku='{$new_sku}'";
$newSkuCount = OmAvailableModel::getTNameCount($tName, $where);
if ($newSkuCount) {
//如果新料号在产品中已经存在,则只添加转换记录
self::$errCode = '200';
self::$errMsg = "修改转换记录成功,新料号:{$new_sku} 已经存在记录";
} else {
//如果新料号在产品表中不存在,则自动添加旧料号的记录进去
unset($newSkuPc['id']);
//去掉旧记录的id
$newSkuPc['sku'] = $new_sku;
//将旧的sku换成新的sku
OmAvailableModel::addTNameRow2arr($tName, $newSkuPc);
self::$errCode = '200';
self::$errMsg = "修改转换记录成功,新料号:{$new_sku} 记录已插入成功";
}
//下面对关联单料号的组合料号进行修改
$tName = 'pc_sku_combine_relation';
$select = '*';
$where = "WHERE sku='{$newSkuPcSku}' group by combineSku";
$skuRelationList = OmAvailableModel::getTNameList($tName, $select, $where);
if (empty($skuRelationList)) {
self::$errMsg .= "<br/>其中,无关联组合料号被更新";
} else {
$combineSkuArr = array();
foreach ($skuRelationList as $value) {
$combineSkuArr[] = $value['combineSku'];
}
$combineSkuStr = implode(',', $combineSkuArr);
$set = "SET sku='{$new_sku}'";
$where = "WHERE sku='{$newSkuPcSku}'";
$affectRows = OmAvailableModel::updateTNameRow($tName, $set, $where);
self::$errMsg .= "<br/>";
self::$errMsg .= "其中,组合料号 {$combineSkuStr} 中共有 {$affectRows} 条单料号数据已更新";
}
//////
BaseModel::commit();
BaseModel::autoCommit();
return;
} catch (Exception $e) {
BaseModel::rollback();
BaseModel::autoCommit();
self::$errCode = '404';
self::$errMsg = $e->getMessage();
return;
}
}
示例5: addExpressRemark
public static function addExpressRemark($omOrderId, $data)
{
!self::$dbConn ? self::initDB() : null;
BaseModel::begin();
//开始事务
if (!self::deleteExpressRemark($omOrderId)) {
BaseModel::rollback();
self::$errCode = "001";
self::$errMsg = " 删除数据失败! ";
return false;
//失败则设置错误码和错误信息, 返回false
}
if (!empty($data)) {
//var_dump($data);
foreach ($data as $datavalue) {
$string = array2sql_extral($datavalue);
//$string = "('".$datavalue['omOrderId']."','". $datavalue['price']."','". $datavalue['amount']."','". $datavalue['hamcodes']."','". $datavalue['isBrand']."','". $datavalue['description']."','". $datavalue['creatorId']."','". $datavalue['createdTime'] ."'),";
$sql = "INSERT INTO " . self::$Table . " SET {$string} ";
//echo $sql;
if (!self::$dbConn->query($sql)) {
BaseModel::rollback();
self::$errCode = "002";
self::$errMsg = " 插入数据失败! ";
return false;
//失败则设置错误码和错误信息, 返回false
}
}
BaseModel::commit();
BaseModel::autoCommit();
self::$errCode = "200";
self::$errMsg = " 插入数据成功! ";
return true;
//失败则设置错误码和错误信息, 返回false
}
}
示例6: view_productsCombineSpuComplete
public function view_productsCombineSpuComplete()
{
$combineSpu = $_GET['combineSpu'] ? $_GET['combineSpu'] : '';
$id = $_GET['id'] ? $_GET['id'] : '';
$userId = $_SESSION['userId'];
$now = time();
if (intval($userId) <= 0) {
$status = "未登录";
header("Location:index.php?mod=products&act=getProductsCombineSpuTakeList&status={$status}&combineSpu={$combineSpu}");
exit;
}
if (empty($id)) {
$status = "id为空";
header("Location:index.php?mod=products&act=getProductsCombineSpuTakeList&status={$status}&combineSpu={$combineSpu}");
exit;
}
$idArr = array_filter(explode(',', $id));
foreach ($idArr as $value) {
if (intval($value) <= 0) {
$status = "含有非法id";
header("Location:index.php?mod=products&act=getProductsCombineSpuTakeList&status={$status}&combineSpu={$combineSpu}");
exit;
}
}
$newIdArr = implode(',', $idArr);
try {
BaseModel::begin();
$tName = 'pc_spu_web_maker';
$set = "SET isComplete=1,completeTime='{$now}'";
$where = "WHERE id in({$newIdArr})";
OmAvailableModel::updateTNameRow($tName, $set, $where);
BaseModel::commit();
BaseModel::autoCommit();
$status = "制作完成成功";
header("Location:index.php?mod=products&act=getProductsCombineSpuTakeList&status={$status}&combineSpu={$combineSpu}");
} catch (Exception $e) {
BaseModel::rollback();
BaseModel::autoCommit();
$status = $e->getMessage();
header("Location:index.php?mod=products&act=getProductsCombineSpuTakeList&status={$status}&combineSpu={$combineSpu}");
}
}
示例7: view_updatePropertyOn
public function view_updatePropertyOn()
{
$id = $_GET['id'];
$propertyName = $_GET['propertyName'] ? post_check(trim($_GET['propertyName'])) : '';
$pid = $_GET['pid'] ? post_check(trim($_GET['pid'])) : '';
$isRadio = $_GET['isRadio'] ? post_check(trim($_GET['isRadio'])) : '';
$isRequired = $_GET['isRequired'] ? post_check(trim($_GET['isRequired'])) : '';
if (intval($id) == 0) {
$status = "属性Id错误";
header("Location:index.php?mod=property&act=getPropertyList&status={$status}");
exit;
}
if (empty($propertyName)) {
if (intval($id) == 0) {
$status = "属性Id错误";
header("Location:index.php?mod=property&act=getPropertyList&status={$status}");
exit;
}
$tName = 'pc_archive_spu_property_value_relation';
$where = "WHERE propertyId={$id}";
$countPP = OmAvailableModel::getTNameCount($tName, $where);
if ($countPP) {
$status = "该属性已经绑定了SPU,不能删除";
header("Location:index.php?mod=property&act=getPropertyList&status={$status}");
exit;
}
$tName = 'pc_archive_property_value';
$select = 'id';
$where = "WHERE propertyId={$id}";
$ppvList = OmAvailableModel::getTNameList($tName, $select, $where);
//该属性下所有的属性值
foreach ($ppvList as $value) {
$propertyValueId = $value['id'];
if (intval($propertyValueId) != 0) {
$tName = 'pc_archive_spu_property_value_relation';
$where = "WHERE propertyId={$id} and propertyValueId={$propertyValueId}";
$countPPV = OmAvailableModel::getTNameCount($tName, $where);
if ($countPPV) {
$status = "该属性下已有属性值绑定了SPU,不能删除";
header("Location:index.php?mod=property&act=getPropertyList&status={$status}");
exit;
}
}
}
try {
BaseModel::begin();
foreach ($ppvList as $value) {
$propertyValueId = $value['id'];
if (intval($propertyValueId) != 0) {
$tName = 'pc_archive_property_value';
$where = "WHERE id={$propertyValueId}";
OmAvailableModel::deleteTNameRow($tName, $where);
}
}
$tName = 'pc_archive_property';
$where = "WHERE id={$id}";
OmAvailableModel::deleteTNameRow($tName, $where);
BaseModel::commit();
BaseModel::autoCommit();
$status = "属性删除成功";
header("Location:index.php?mod=property&act=getPropertyList&status={$status}");
exit;
} catch (Exception $e) {
BaseModel::rollback();
BaseModel::autoCommit();
$status = $e->getMessage();
header("Location:index.php?mod=property&act=getPropertyList&status={$status}");
exit;
}
}
if (empty($pid)) {
$status = "类型不能为空";
header("Location:index.php?mod=property&act=getPropertyList&status={$status}");
exit;
}
if (empty($isRadio)) {
$status = "录入方式不能为空";
header("Location:index.php?mod=property&act=getPropertyList&status={$status}");
exit;
}
if (intval($isRequired) == 0) {
$status = "是否必填不能为空";
header("Location:index.php?mod=property&act=getPropertyList&status={$status}");
exit;
}
$tName = 'pc_archive_property';
$select = '*';
$where = "WHERE id='{$id}'";
$propertyList = OmAvailableModel::getTNameList($tName, $select, $where);
if (empty($propertyList)) {
$status = "不存在该属性记录";
header("Location:index.php?mod=property&act=getPropertyList&status={$status}");
exit;
}
$categoryName = getAllCateNameByPath($pid);
$pathImplodeStr = getAllPathBypid($pid);
$i = strrpos($pathImplodeStr, ',');
if ($i !== false) {
$pathImplodeStr = substr($pathImplodeStr, 0, $i);
}
//.........这里部分代码省略.........
示例8: createOwOrder
//.........这里部分代码省略.........
//采购数量
$detail['goods_recommend_count'] = $sku['rec'];
//采购数量
$detail['recordnumber'] = $orderData['recordnumber'];
$poid = $orderData['id'];
//根据跟踪号取采购主订单编号
$detail['parid'] = $parid;
//料号供应商ID
$detail['po_id'] = $poid;
$dataSet = array2sql($detail);
$sql = "insert into ph_ow_order_detail set {$dataSet} ";
$rtndetail = $dbConn->execute($sql);
if ($rtndetail === false) {
$rollback = true;
} else {
$ismark = 1;
}
} else {
//不存在符合条件的跟踪号重新生成
$recordnumber = PurchaseOrderModel::autoCreateOrderSn($purid, $comid);
//生成对应公司的采购订单跟踪号
if (!empty($recordnumber)) {
//生成采购订单号成功
$main['recordnumber'] = $recordnumber;
//跟踪号
$main['purchaseuser_id'] = $purid;
//采购员ID
$main['operator_id'] = $operator_id;
//操作人员id
$main['warehouse_id'] = $storeid;
//仓库ID
$main['company_id'] = $comid;
//公司编号
$main['partner_id'] = $parid;
//供应商ID
$main['addtime'] = time();
if ($type == "oversea") {
$main['order_type'] = 5;
// 给海外仓备货的订单
} else {
$main['order_type'] = 1;
// 正常订单
}
$dataSet = array2sql($main);
$sql = "insert into ph_ow_order set {$dataSet} ";
$rtnmain = $dbConn->execute($sql);
if ($rtnmain) {
//主订单添加成功
/*
$orderHasSku = OwOrderModel::orderExistSku($sku['sku']);
if($orderHasSku){
$existSku .= '['.$sku['sku'].'],';
continue;
}*/
$detail['sku'] = $sku['sku'];
$detail['price'] = $price;
//单价
$detail['count'] = $sku['rec'];
//采购数量
$detail['goods_recommend_count'] = $sku['rec'];
//采购数量
$detail['parid'] = $parid;
//料号供应商ID
$detail['recordnumber'] = $recordnumber;
$poid = OwOrderModel::getOwPoid($recordnumber);
//根据跟踪号取采购主订单编号
$detail['po_id'] = $poid;
$dataSet = array2sql($detail);
$sql = "insert into ph_ow_order_detail set {$dataSet} ";
$rtndetail = $dbConn->execute($sql);
if ($rtndetail === false) {
$rollback = true;
} else {
$ismark = 1;
}
} else {
$rollback = true;
}
} else {
$rollback = true;
}
}
}
//$existSku = substr($existSku, 0, strlen($existSku) - 1);
if ($rollback == false) {
//if($ismark == 1){
BaseModel::commit();
BaseModel::autoCommit();
$result['msg'] = 'yes';
//}else{
// $result['msg'] = 'warn';
//}
//$result['tip'] = $existSku;
} else {
BaseModel::rollback();
BaseModel::autoCommit();
$result['msg'] = 'no';
}
return json_encode($result);
}
示例9: view_updateSpuPersonOn
//.........这里部分代码省略.........
$dataEbayArr['isAgree'] = 1;
//add by zqt 20140421,如果换人了的话,则变为待定状态
$dataEbayArr['addTime'] = time();
OmAvailableModel::updateTNameRow2arr($tName, $dataEbayArr, $where);
}
} else {
//插入新数据时,则默认销售同意/拒绝状态为待定
$dataEbayArr = array();
$dataEbayArr['spu'] = $spu;
$dataEbayArr['salerId'] = $amazonSalerId;
$dataEbayArr['platformId'] = 11;
$dataEbayArr['addTime'] = time();
$dataEbayArr['isAgree'] = 1;
OmAvailableModel::addTNameRow2arr($tName, $dataEbayArr);
}
}
if (!empty($overseaSalerId)) {
$where = "WHERE is_delete=0 AND spu='{$spu}' AND platformId=14";
//amazon平台
$ebaySpuSalerList = OmAvailableModel::getTNameList($tName, $select, $where);
if (!empty($ebaySpuSalerList)) {
//更新时如果人员改动会更新是否接手状态,但是不会更新是否被销售同意/拒绝状态
if ($ebaySpuSalerList[0]['salerId'] != $overseaSalerId) {
$dataEbayArr = array();
$dataEbayArr['salerId'] = $overseaSalerId;
$dataEbayArr['isAgree'] = 1;
//add by zqt 20140421,如果换人了的话,则变为待定状态
$dataEbayArr['addTime'] = time();
OmAvailableModel::updateTNameRow2arr($tName, $dataEbayArr, $where);
}
} else {
//插入新数据时,则默认销售同意/拒绝状态为待定
$dataEbayArr = array();
$dataEbayArr['spu'] = $spu;
$dataEbayArr['salerId'] = $overseaSalerId;
$dataEbayArr['platformId'] = 14;
$dataEbayArr['addTime'] = time();
$dataEbayArr['isAgree'] = 1;
OmAvailableModel::addTNameRow2arr($tName, $dataEbayArr);
}
}
if (!empty($webMakerId)) {
$tName = 'pc_spu_web_maker';
$select = 'webMakerId,isAgree,isTake';
$where = "WHERE is_delete=0 AND spu='{$spu}' order by id desc limit 1";
$spuWebMakerList = OmAvailableModel::getTNameList($tName, $select, $where);
if (empty($spuWebMakerList)) {
//不存在该SPU的指派记录
$dataWebMakerArr = array();
$dataWebMakerArr['spu'] = $spu;
$dataWebMakerArr['isSingSpu'] = $isSingSpu;
$dataWebMakerArr['webMakerId'] = $webMakerId;
$dataWebMakerArr['isAgree'] = 1;
//add by 20140513,待定状态
$dataWebMakerArr['addTime'] = time();
OmAvailableModel::addTNameRow2arr($tName, $dataWebMakerArr);
} else {
//存在指派记录时
if ($spuWebMakerList[0]['webMakerId'] != $webMakerId) {
//提交的人和之前的不一致则修改/添加,否则不变
if ($spuWebMakerList[0]['isTake'] == 1) {
//如果是已经被工程师领取,则表示接手
$dataWebMakerArr = array();
$dataWebMakerArr['spu'] = $spu;
$dataWebMakerArr['isSingSpu'] = $isSingSpu;
$dataWebMakerArr['webMakerId'] = $webMakerId;
$dataWebMakerArr['addTime'] = time();
$dataWebMakerArr['isAgree'] = $spuWebMakerList[0]['isAgree'];
//add by 20140513,同意/拒绝状态不变
$dataWebMakerArr['isHandsOn'] = 1;
OmAvailableModel::addTNameRow2arr($tName, $dataWebMakerArr);
} else {
//如果未被领取,则只是修改记录
$dataWebMakerArr = array();
$dataWebMakerArr['webMakerId'] = $webMakerId;
$dataWebMakerArr['addTime'] = time();
$dataWebMakerArr['isAgree'] = 1;
//add by 20140513,未领取的话,重新变成待定状态
OmAvailableModel::updateTNameRow2arr($tName, $dataWebMakerArr, $where);
}
}
}
}
BaseModel::commit();
BaseModel::autoCommit();
$status = "更新成功";
echo '<script language="javascript">
alert("' . $status . '");
</script>';
exit;
} catch (Exception $e) {
BaseModel::rollback();
BaseModel::autoCommit();
$status = $e->getMessage();
echo '<script language="javascript">
alert("' . '添加失败——' . $status . '");
</script>';
exit;
}
}
示例10: act_updateSpecialTMTCOn
public function act_updateSpecialTMTCOn()
{
$id = $_POST['id'] ? trim($_POST['id']) : 0;
$specialTransportManagerName = $_POST['specialTransportManagerName'] ? trim($_POST['specialTransportManagerName']) : '';
$isOn = $_POST['isOn'] ? trim($_POST['isOn']) : '';
//$canOrNot = $_POST['canOrNot'] ? (trim($_POST['canOrNot'])) : '';
$transportIdArr = !empty($_POST['transportId']) ? $_POST['transportId'] : array();
//选中的transportId数组
//print_r($transportIdArr);exit;
$tName = 'pc_special_transport_manager';
$where = "WHERE id='{$id}'";
$pspIsExist = OmAvailableModel::getTNameCount($tName, $where);
if (!$pspIsExist) {
$status = "记录不存在,错误";
echo '<script language="javascript">
alert("' . $status . '");
</script>';
exit;
}
if (empty($specialTransportManagerName)) {
$status = "特殊运输方式名称为空";
echo '<script language="javascript">
alert("' . $status . '");
</script>';
exit;
}
if (intval($isOn) <= 0) {
$status = "是否启用有误";
echo '<script language="javascript">
alert("' . $status . '");
</script>';
exit;
}
if (empty($transportIdArr)) {
$status = "所选的运输方式为空,错误";
echo '<script language="javascript">
alert("' . $status . '");
</script>';
exit;
}
$tName = 'pc_special_transport_manager';
$where = "WHERE specialTransportManagerName='{$specialTransportManagerName}' AND id<>'{$id}'";
$properNameIsExist = OmAvailableModel::getTNameCount($tName, $where);
if ($properNameIsExist) {
$status = "该特殊运输方式名称已经存在,请检查";
echo '<script language="javascript">
alert("' . $status . '");
</script>';
exit;
}
try {
BaseModel::begin();
$tName = 'pc_special_transport_manager';
$dataTmpArr = array();
$dataTmpArr['specialTransportManagerName'] = $specialTransportManagerName;
$dataTmpArr['isOn'] = $isOn;
$where = "WHERE id='{$id}'";
OmAvailableModel::updateTNameRow2arr($tName, $dataTmpArr, $where);
$tName = 'pc_special_stmnid_transportid';
$select = '*';
$where = "WHERE stmnId='{$id}'";
$psptList = OmAvailableModel::getTNameList($tName, $select, $where);
$psptIdArr = array();
foreach ($psptList as $value) {
$psptIdArr[] = $value['id'];
}
$psptIdStr = !empty($psptIdArr) ? implode(',', $psptIdArr) : 0;
$tName = 'pc_special_stid_channel';
$where = "WHERE stId in({$psptIdStr})";
OmAvailableModel::deleteTNameRow($tName, $where);
//删除渠道关系表的相关数据
$tName = 'pc_special_stmnid_transportid';
$where = "WHERE stmnId='{$id}'";
OmAvailableModel::deleteTNameRow($tName, $where);
//删除运输方式关系表的相关数据
foreach ($transportIdArr as $transportId) {
if (intval($transportId) > 0) {
$channelIdArr = !empty($_POST['tc' . $transportId]) ? $_POST['tc' . $transportId] : array();
//该transpordeId下的channel数组
$tName = 'pc_special_stmnid_transportid';
$dataTmpArr = array();
$dataTmpArr['stmnId'] = $id;
$dataTmpArr['transportId'] = $transportId;
$insertPTId = OmAvailableModel::addTNameRow2arr($tName, $dataTmpArr);
if (intval($insertPTId) <= 0) {
throw new Exception('insertPTId 错误');
}
foreach ($channelIdArr as $channelId) {
if (intval($channelId) > 0) {
$tName = 'pc_special_stid_channel';
$dataTmpArr = array();
$dataTmpArr['stId'] = $insertPTId;
$dataTmpArr['channelId'] = $channelId;
OmAvailableModel::addTNameRow2arr($tName, $dataTmpArr);
}
}
}
}
BaseModel::commit();
BaseModel::autoCommit();
//.........这里部分代码省略.........
示例11: shiftOrderList
public static function shiftOrderList($where)
{
BaseModel::begin();
//开始事务
$unshipped_tableName = 'om_unshipped_order';
$shipped_tableName = 'om_shipped_order';
$orderList = self::showOrderList($unshipped_tableName, $where);
//echo "<pre>"; print_r($orderList); exit;
if (empty($orderList)) {
self::$errCode = '000';
self::$errMsg = "无操作数据!";
return false;
}
foreach ($orderList as $omOrderId => $orderData) {
$obj_order_data = $orderData['orderData'];
$orderDetail = $orderData['orderDetail'];
$insert_orderDetail = array();
foreach ($orderDetail as $detail) {
$insert_orderDetailData = $detail['orderDetailData'];
//unset ($insert_orderDetailData['id']);
$insert_orderDetailExtenData = $detail['orderDetailExtenData'];
//unset ($insert_orderDetailExtenData['omOrderdetailId']);
$insert_orderDetail[] = array('orderDetailData' => $insert_orderDetailData, 'orderDetailExtenData' => $insert_orderDetailExtenData);
}
//BaseModel :: rollback();\
//self :: $dbConn->query('SET AUTOCOMMIT=1');
//return FALSE;
//unset ($obj_order_data['id']);
$orderExtenData = $orderData['orderExtenData'];
//unset ($orderExtenData['omOrderId']);
$orderUserInfoData = $orderData['orderUserInfoData'];
//unset ($orderExtenData['omOrderId']);
$orderWhInfoData = $orderData['orderWhInfoData'];
//unset ($orderWhInfoData['omOrderId']);
//$obj_order_data['orderStatus'] = C('STATEBUJI');
//$obj_order_data['orderType'] = C('STATEBUJI_DONE');
$insert_orderData = array();
$insert_orderData = array('orderData' => $obj_order_data, 'orderExtenData' => $orderExtenData, 'orderUserInfoData' => $orderUserInfoData, 'orderDetail' => $insert_orderDetail, 'orderWhInfoData' => $orderWhInfoData);
//var_dump($insert_orderData); exit;
if ($insertId = OrderAddModel::shiftAllOrderRowNoEvent($insert_orderData)) {
//echo $split_log .= 'insert success!' . "\n"; exit;
//var_dump($_mainId,$_spitId); exit;
if (!OrderLogModel::insertOrderLog($insertId, '从unshipped表转移数据到shipped表中,第一步:添加shipped表数据')) {
BaseModel::rollback();
self::$errCode = '001';
self::$errMsg = "转移数据添加日志失败,第一步:添加shipped表数据失败!";
return false;
}
} else {
BaseModel::rollback();
self::$errCode = '002';
self::$errMsg = "INSERT数据失败!";
return false;
}
if (self::killAllOrderRowNoEvent($omOrderId, $obj_order_data['platformId'])) {
//echo $split_log .= 'insert success!' . "\n"; exit;
//var_dump($_mainId,$_spitId); exit;
if (!OrderLogModel::insertOrderLog($omOrderId, '从unshipped表转移数据到shipped表中,第二步:删除unshipped表中数据')) {
BaseModel::rollback();
self::$errCode = '003';
self::$errMsg = "转移数据添加日志失败,第二步:删除unshipped表中数据失败!";
return false;
}
} else {
BaseModel::rollback();
self::$errCode = '004';
self::$errMsg = "KILL数据失败!";
return false;
}
}
BaseModel::commit();
BaseModel::autoCommit();
self::$errCode = '200';
self::$errMsg = "转移数据成功!";
return TRUE;
}
示例12: insertAllOrderRow
//.........这里部分代码省略.........
$flagCountUnshipped = OmAvailableModel::getTNameCount($tName, $where);
$tName = 'om_shipped_order_extension_ebay';
$flagCountshipped = OmAvailableModel::getTNameCount($tName, $where);
} else {
$tName = 'om_unshipped_order';
$where = "WHERE accountId='{$obj_order_data['accountId']}' AND recordNumber='{$obj_order_data['recordNumber']}' AND platformId={$obj_order_data['platformId']} and is_delete ='0'";
$flagCountUnshipped = OmAvailableModel::getTNameCount($tName, $where);
$tName = 'om_shipped_order';
$flagCountshipped = OmAvailableModel::getTNameCount($tName, $where);
}
//if (empty ($flagCountUnshipped) && empty ($flagCountshipped)) { //判断订单是否已经在系统2个订单表(未发货和已发货)中存在
if (empty($flagCountUnshipped) && empty($flagCountshipped)) {
$platfrom = omAccountModel::getPlatformSuffixById($obj_order_data['platformId']);
$extension = $platfrom['suffix'];
//获取后缀名称
BaseModel::begin();
//开始事务
$insertOrderDataRow = self::insertOrderRow($obj_order_data);
//插入到order表
if (empty($insertOrderDataRow)) {
BaseModel::rollback();
//throw new Exception('insert orderData error');
}
$orderExtenData['omOrderId'] = $insertOrderDataRow;
$orderUserInfoData['omOrderId'] = $insertOrderDataRow;
$resultExten = self::insertExtension($orderExtenData, $extension);
//插入到order_extend表
if (!$resultExten) {
BaseModel::rollback();
//throw new Exception('insert orderExtenData error');
}
$resultUserInfo = self::insertUserinfoRow($orderUserInfoData);
//插入到order_userInfo表
if (!$resultUserInfo) {
BaseModel::rollback();
//throw new Exception('insert orderUserInfoData error');
}
foreach ($orderDetailArr as $orderDetail) {
$orderDetailData = $orderDetail['orderDetailData'];
$orderDetailExtenData = $orderDetail['orderDetailExtenData'];
$orderDetailData['omOrderId'] = $insertOrderDataRow;
$orderDetailData['createdTime'] = time();
$insertOrderDatilRow = self::insertOrderdetail($orderDetailData);
//插入到detail表
if (empty($insertOrderDatilRow)) {
BaseModel::rollback();
//throw new Exception('insert orderDetailData error');
}
$orderDetailExtenData['omOrderdetailId'] = $insertOrderDatilRow;
if ($orderDetailExtenData) {
$resultOrderDetailExten = self::insertDetailExtension($orderDetailExtenData, $extension);
//插入到detailExtend
if (!$resultOrderDetailExten) {
BaseModel::rollback();
//throw new Exception('insert orderDetailExtenData error');
}
}
}
if ($obj_order_data['platformId'] == 1) {
$insertOrderidsDada = array('omOrderId' => $insertOrderDataRow, 'PayPalPaymentId' => $orderData['orderExtenData']['PayPalPaymentId'], 'orderid' => $orderData['orderExtenData']['orderId'], 'accountId' => $orderData['orderData']['accountId'], 'saletime' => time());
$insertOrderids = OrderidsModel::insertOrderidsList($insertOrderidsDada);
if (!$insertOrderids) {
BaseModel::rollback();
//throw new Exception('insert orderIds error');
}
}
if (isset($orderData['orderNote']) && !empty($orderData['orderNote'])) {
$orderNote = $orderData['orderNote'];
$insertOrderNoteDada = array('omOrderId' => $insertOrderDataRow, 'content' => $orderNote['content'], 'userId' => $orderNote['userId'], 'createdTime' => $orderNote['createdTime']);
$insertOrderNoteids = OrderAddModel::insertOrderNotesRow($insertOrderNoteDada);
if (!$insertOrderNoteids) {
BaseModel::rollback();
//throw new Exception('insert orderNote error');
}
}
$buyerInfo = $orderUserInfoData;
$buyerInfo['platformId'] = $obj_order_data['platformId'];
unset($buyerInfo['omOrderId']);
unset($buyerInfo['countrySn']);
unset($buyerInfo['currency']);
unset($buyerInfo['currency']);
$insertBuyerInfo = self::insertBuyerInfoRow($buyerInfo);
if (!$insertBuyerInfo) {
BaseModel::rollback();
//throw new Exception('insert BuyerInfo error');
}
$ProductStatus = new ProductStatus();
if (!$ProductStatus->updateSkuStatusByOrderStatus(array($insertOrderDataRow))) {
BaseModel::rollback();
//throw new Exception('update puchaseinfo error');
}
BaseModel::commit();
BaseModel::autoCommit();
return $insertOrderDataRow;
} else {
self::$errCode = "400";
self::$errMsg = "已经包含订单信息,不能重复插入!";
return false;
}
}
示例13: act_operateAbOrderAPI
//.........这里部分代码省略.........
$insert_orderUserInfoData = $orderUserInfoData;
unset($insert_orderUserInfoData['omOrderId']);
//$orderTracknumber = $order['orderTracknumber'];
//$orderAudit = $order['orderAudit'];
$orderDetail = $order['orderDetail'];
$insertOrderData['orderData'] = $insert_orderData;
$insertOrderData['orderExtenData'] = $insert_orderExtenData;
$insertOrderData['orderUserInfoData'] = $insert_orderUserInfoData;
$insert_orderDetail = array();
$need_delete_ids = array();
foreach ($orderDetail as $dkey => $detailValue) {
$orderDetailData = $detailValue['orderDetailData'];
$orderDetailExtenData = $detailValue['orderDetailExtenData'];
if (!isset($AbOrderInfo[$orderDetailData['sku']]) || $AbOrderInfo[$orderDetailData['sku']] == 0) {
$insert_orderDetailData = $orderDetailData;
unset($insert_orderDetailData['id']);
unset($insert_orderDetailData['omOrderId']);
$insert_orderDetailExtenData = $orderDetailExtenData;
unset($insert_orderDetailExtenData['omOrderdetailId']);
$insert_orderDetail[$dkey]['orderDetailData'] = $insert_orderDetailData;
$insert_orderDetail[$dkey]['orderDetailExtenData'] = $insert_orderDetailExtenData;
$need_delete_ids[] = $orderDetailData['id'];
}
}
$insertOrderData['orderDetail'] = $insert_orderDetail;
$count_insert_orderDetail = count($insert_orderDetail);
$count_orderDetail = count($orderDetail);
$tableName = "om_unshipped_order";
if ($count_insert_orderDetail > 0 && $count_insert_orderDetail < $count_orderDetail) {
$calcWeight = CommonModel::calcNowOrderWeight($orderId);
//重新计算原来订单的重量
if (!OrderindexModel::deleteOrderDetail(array('is_delete' => 1), ' where id in(' . join(',', $need_delete_ids) . ')')) {
BaseModel::rollback();
self::$errCode = '005';
self::$errMsg = "删除原订单明细失败!";
return false;
}
$insertOrderData['orderData']['isCopy'] = 2;
$insertOrderData['orderData']['actualTotal'] = 0.0;
//var_dump($orderData);exit;
$calcInfo = CommonModel::calcAddOrderWeight($insert_orderDetail);
//计算重量和包材
//var_dump($calcInfo); exit;
$insertOrderData['orderData']['calcWeight'] = $calcInfo[0];
$insertOrderData['orderData']['pmId'] = $calcInfo[1];
if (count($insertOrderData['orderDetail']) > 1) {
$insertOrderData['orderData']['orderAttribute'] = 3;
} else {
if (isset($insertOrderData['orderDetail'][0]['orderDetailData']['amount']) && $insertOrderData['orderDetail'][0]['orderDetailData']['amount'] > 1) {
$insertOrderData['orderData']['orderAttribute'] = 2;
}
}
$calcShippingInfo = CommonModel::calcAddOrderShippingFee($insertOrder, 1);
//计算运费
$insertOrderData['orderData']['channelId'] = $calcShippingInfo['fee']['channelId'];
$insertOrderData['orderData']['calcShipping'] = $calcShippingInfo['fee']['fee'];
//print_r($insertOrderData); exit;
if ($_spitId = OrderAddModel::insertAllOrderRowNoEvent($insertOrderData)) {
if (!OrderLogModel::insertOrderLog($_spitId, 'INSERT ORDER')) {
BaseModel::rollback();
self::$errCode = '001';
self::$errMsg = "插入订单日志失败!";
return false;
}
if (!OrderRecordModel::insertSpitRecords($orderId, $_spitId)) {
BaseModel::rollback();
self::$errCode = '002';
self::$errMsg = "插入拆分日志失败!";
return false;
}
} else {
BaseModel::rollback();
self::$errCode = '010';
self::$errMsg = "插入订单信息失败!";
return false;
}
$returnStatus0 = array('isCopy' => 1, 'calcWeight' => $calcWeight);
$rtn = $WarehouseAPIAct->act_operateAbOrder($invoiceids[$k], $calcWeight);
if (!$rtn) {
BaseModel::rollback();
self::$errCode = '011';
self::$errMsg = "调用仓库系统拆分功能失败!";
return false;
}
} else {
$returnStatus0 = array('orderStatus' => $insert_orderData['orderStatus'], 'orderType' => $insert_orderData['orderType']);
}
if (!OrderindexModel::updateOrder($tableName, $returnStatus0, $where)) {
BaseModel::rollback();
self::$errCode = '002';
self::$errMsg = "订单移动到缺货异常失败!";
return false;
}
BaseModel::commit();
BaseModel::autoCommit();
}
self::$errCode = 200;
self::$errMsg = '缺货拆分完成!';
return true;
}
示例14: act_confirmReceivingByMFG
function act_confirmReceivingByMFG()
{
$ioStoreId = !empty($_POST['ioStoreId']) ? $_POST['ioStoreId'] : 0;
$comfirmUserId = $_SESSION['userId'];
$now = time();
if (intval($ioStoreId) <= 0) {
self::$errCode = '101';
self::$errMsg = "id有误";
return false;
}
if (intval($comfirmUserId) <= 0) {
self::$errCode = '102';
self::$errMsg = "登陆超时,请重试";
return false;
}
$tName = 'pc_products_iostore';
$select = '*';
$where = "WHERE is_delete=0 AND isAudit=2 AND id='{$ioStoreId}'";
$ioStoreList = OmAvailableModel::getTNameList($tName, $select, $where);
if (empty($ioStoreList)) {
self::$errCode = '103';
self::$errMsg = "该单据不存在或者未审核通过";
return false;
}
try {
BaseModel::begin();
//标记表头已经确认
$dataIoStore = array();
$dataIoStore['isComfirm'] = 2;
//标记单据已经确认
$dataIoStore['comfirmUserId'] = $comfirmUserId;
$dataIoStore['comfirmTime'] = $now;
OmAvailableModel::updateTNameRow2arr($tName, $dataIoStore, $where);
//标记表体确认
$tName = 'pc_products_iostore_detail';
$dataIoStoreDetail = array();
$dataIoStoreDetail['isComfirm'] = 2;
$where = "WHERE iostoreId='{$ioStoreId}'";
OmAvailableModel::updateTNameRow2arr($tName, $dataIoStoreDetail, $where);
//如果是新品领料单,则产品部确认后,该单据下的sku才进入产品制作表
if ($ioStoreList[0]['iostoreTypeId'] == 1 && $ioStoreList[0]['useTypeId'] == 1) {
$select = 'sku';
$skuList = OmAvailableModel::getTNameList($tName, $select, $where);
foreach ($skuList as $value) {
$sku = $value['sku'];
$tName = 'pc_products';
$dataProducts = array();
$dataProducts['sku'] = $sku;
OmAvailableModel::addTNameRow2arr($tName, $dataProducts);
//将detail中的sku加入到产品制作表中
}
}
BaseModel::commit();
BaseModel::autoCommit();
self::$errCode = '200';
self::$errMsg = "确认收货成功";
return true;
} catch (Exception $e) {
BaseModel::rollback();
BaseModel::autoCommit();
self::$errCode = '404';
self::$errMsg = $e->getMessage();
return false;
}
}
示例15: foreach
$osql = "select * from om_express_remark where omOrderId = '{$omOrderId}' ";
$query = $dbConn->query($osql);
$oldremarks = $dbConn->fetch_array_all($query);
if ($oldremarks) {
$usql = "delete from om_express_remark where omOrderId = '{$omOrderId}' ";
if (!$dbConn->query($usql)) {
echo $usql;
echo "\n";
BaseModel::rollback();
} else {
$osql = "select * from om_express_remark_bak where omOrderId = '{$omOrderId}' ";
$query = $dbConn->query($osql);
$remarkValues = $dbConn->fetch_array_all($query);
foreach ($remarkValues as $info) {
$info['lastModified'] = time();
$info['description'] = mysql_real_escape_string(trim($info['description']));
$string = array2sql_extral($info);
$sql = "insert into om_express_remark set " . $string;
//echo $sql; echo "\n";
if (!$dbConn->query($sql)) {
echo $sql;
echo "\n";
BaseModel::rollback();
}
}
}
}
BaseModel::commit();
BaseModel::autoCommit();
}
exit;