Commit ae71e50a authored by liuyuzhen's avatar liuyuzhen

测试购物车

parent 5f058bd6
......@@ -313,12 +313,12 @@ class GoodsModel extends \DAO\AbstractModel {
$updateAllSql = $baseSql;
$dataIds = array();
for ($i = 0; $i < count($datas); $i++) {
$updateSql = \Our\Common::format(" WHEN {0} THEN goods_storage{2}{1},", $datas[$i]['goodsId'], $datas[$i]['goodsNum'],\Our\ArrayConst::ops[$op]);
$updateSql = \Our\Common::format(" WHEN {0} THEN goods_storage{2}{1} END,", $datas[$i]['goodsId'], $datas[$i]['goodsNum'],\Our\ArrayConst::ops[$op]);
$dataIds[] = $datas[$i]['goodsId'];
$updateAllSql .= $updateSql;
if ($i % 1000 == 0 && $i != 0) {
$updateAllSql = trim($updateAllSql,',');
$updateAllSql .= \Our\Common::format(' END where goods_id in ({0})',implode(',',$dataIds));
$updateAllSql .= \Our\Common::format(' where goods_id in ({0})',implode(',',$dataIds));
$one = $this->db->update($this->_tableName)->query($updateAllSql);
if (!$one) {
$error++;
......@@ -329,7 +329,7 @@ class GoodsModel extends \DAO\AbstractModel {
}
if ($updateAllSql != $baseSql) {
$updateAllSql = trim($updateAllSql,',');
$updateAllSql .= \Our\Common::format(' END where goods_id in ({0})',implode(',',$dataIds));
$updateAllSql .= \Our\Common::format(' where goods_id in ({0})',implode(',',$dataIds));
$one = $this->db->update($this->_tableName)->query($updateAllSql);
if (!$one) {
$error++;
......
......@@ -61,7 +61,7 @@ class StoreTopSaleGoodsModel extends \DAO\AbstractModel{
if ($storeGoods) {
$orderGoods = empty($orderGoods)?$storeGoods:array_merge($orderGoods, $storeGoods);
}else{
$singleStoreGoods = $this->getList(array('store_id'=>$storeId));
$singleStoreGoods = $this->getList(array('store_id'=>$storeId,'goods_commonid'=>array('neq','')));
if($singleStoreGoods){
$ordesGoods = empty($orderGoods)?$singleStoreGoods:array_merge($orderGoods,$singleStoreGoods);
$storeTopSaleGoodsRedis->update($storeId,$singleStoreGoods,\Our\ApiConst::oneDaySecond);
......
......@@ -935,7 +935,7 @@ class LinkMySQLModel{
return false;
}
}else{
if (empty($array) || !$key ||( count($array) != 2)|| $array[1] === '' || $array[1] === null) {
if (empty($array) || !$key ||( count($array) != 2)) {
return false;
}
}
......
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