Commit c4053255 authored by liuyuzhen's avatar liuyuzhen

Merge branch 'master_dev' of git.shenbd.com:qm-develop/shenbd into lyz

parents 7f8d970a 46dcaffd
......@@ -67,6 +67,9 @@ class GoodsCommonModel extends \DAO\AbstractModel {
*/
public function getGoodsList($where,$field,$limit=array(),$order=array(),$attrStr=''){
$this->setDb($this->dbName);
if($attrStr) {
$field = 'DISTINCT '.$field;
}
$str = '$data = $this->db->select($field)->from($this->_tableName)';
if($attrStr){
$str .="->join('han_goods_attribute_value','han_goods_attribute_value.goods_commonid = han_goods_common.goods_commonid')";
......@@ -99,6 +102,10 @@ class GoodsCommonModel extends \DAO\AbstractModel {
*/
public function getListWithSale($where,$field,$actIds,$limit=array(),$order=array(),$attrStr='',$online = true){
$this->setDb($this->dbName);
if($attrStr) {
$attrStr = '('.$attrStr.')';
$field = ' DISTINCT '.$field;
}
$str = "select ".$field." FROM ".$this->_tableName." LEFT JOIN (SELECT MIN(discount_price) discount_price,goods_commonid,goods_id FROM han_sale_goods where sale_act_id in(".implode(',',$actIds).") GROUP BY goods_commonid) a on (han_goods_common.goods_commonid = a.goods_commonid)";
if($attrStr){
$str .= "INNER JOIN han_goods_attribute_value ON han_goods_attribute_value.goods_commonid = han_goods_common.goods_commonid ";
......
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