Commit d7625325 authored by liuyuzhen's avatar liuyuzhen

下单时组合销售序列化数据写入

parent 91a698c0
......@@ -445,12 +445,14 @@ class OrderConfirmUtil {
$orderGoods['goods_group'] = serialize($storeCart['goodsList']);
$orderGoods['goods_price'] = $storeCart['goodsPrice'];
$orderGoods['goods_commonid'] = \Our\ApiConst::zero;
$orderGoods['goods_spec'] = null;
}else{
$orderGoods['goods_price'] = \Goods\GoodsUtil::getInstance()->getRealPrice($storeCart['goodsId'],$this->memberId);
$orderGoods['goods_commonid'] = $storeCart['goodsCommonId'];
if($orderGoods['sale_act_id']&&$orderGoods['sale_id']){//当前商品有参与销售活动结算时
$this->saleGoodsIds[] = $storeCart['goodsId'];
}
$orderGoods['goods_group'] = null;
}
$orderGoods['gmt_create'] = TIMESTAMP;
......
......@@ -168,10 +168,10 @@ class OrderGoodsModel extends \DAO\AbstractModel {
public function insertAll($datas){
$this->setDb(\Our\DbNameConst::masterDBConnectName);
$error = 0;
$baseSql = "insert IGNORE into {$this->_tableName}(order_id,store_id,goods_id,goods_name,goods_num,goods_image,goods_price,goods_pay_price,buyer_id,snapshot_id,goods_spec,goods_commonid,gc_id,gc_id_1,gc_id_2,gc_id_3,gmt_create,gmt_update,sale_act_id,sale_id) values";
$baseSql = "insert IGNORE into {$this->_tableName}(order_id,store_id,goods_id,goods_name,goods_num,goods_image,goods_price,goods_pay_price,buyer_id,snapshot_id,goods_spec,goods_commonid,gc_id,gc_id_1,gc_id_2,gc_id_3,gmt_create,gmt_update,sale_act_id,sale_id,goods_group) values";
$insertAllSql = $baseSql;
for ($i = 0; $i < count($datas); $i++) {
$addSql = \Our\Common::format("('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}','{16}','{17}','{18}','{19}'),", $datas[$i]['order_id'], $datas[$i]['store_id'], $datas[$i]['goods_id'], $datas[$i]['goods_name'], $datas[$i]['goods_num'], $datas[$i]['goods_image'], $datas[$i]['goods_price'], $datas[$i]['goods_pay_price'], $datas[$i]['buyer_id'], $datas[$i]['snapshot_id'], $datas[$i]['goods_spec'], $datas[$i]['goods_commonid'], $datas[$i]['gc_id'], $datas[$i]['gc_id_1'], $datas[$i]['gc_id_2'], $datas[$i]['gc_id_3'], $datas[$i]['gmt_create'], $datas[$i]['gmt_update'], $datas[$i]['sale_act_id'], $datas[$i]['sale_id']);
$addSql = \Our\Common::format("('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}','{16}','{17}','{18}','{19}','{20}'),", $datas[$i]['order_id'], $datas[$i]['store_id'], $datas[$i]['goods_id'], $datas[$i]['goods_name'], $datas[$i]['goods_num'], $datas[$i]['goods_image'], $datas[$i]['goods_price'], $datas[$i]['goods_pay_price'], $datas[$i]['buyer_id'], $datas[$i]['snapshot_id'], $datas[$i]['goods_spec'], $datas[$i]['goods_commonid'], $datas[$i]['gc_id'], $datas[$i]['gc_id_1'], $datas[$i]['gc_id_2'], $datas[$i]['gc_id_3'], $datas[$i]['gmt_create'], $datas[$i]['gmt_update'], $datas[$i]['sale_act_id'], $datas[$i]['sale_id'],$datas[$i]['goods_group']);
$insertAllSql .= $addSql;
if ($i % 1000 == 0 && $i != 0) {
$insertAllSql = rtrim($insertAllSql, ',');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment