zhengwei 6 年之前
父節點
當前提交
d564614b5b
共有 3 個文件被更改,包括 18 次插入7 次删除
  1. 1 1
      WebContent/static/mobile/js/productCategory.js
  2. 13 2
      src/com/mall/model/product/Product.java
  3. 4 4
      src/config.properties

+ 1 - 1
WebContent/static/mobile/js/productCategory.js

@@ -106,7 +106,7 @@ function getProduct(type){
                             html.push('<div class="info-title">'+item.product_name+'</div>');
                             html.push('<div class="items">');
                             html.push('<div class="product-price item"><em>¥'+item.product_price+'<span class="del-line color3 ml5">'+item.product_old_price+'元</span></em></div>')
-                            html.push('<div class="fs12 color3">关注:'+item.visit_num+'</div>')
+                            html.push('<div class="fs12 color3">'+item.visit_num+'人关注</div>')
                             html.push('</div></div>');
                             html.push('</a>');
 						});

+ 13 - 2
src/com/mall/model/product/Product.java

@@ -5,6 +5,7 @@ import com.jfinal.plugin.activerecord.Db;
 import com.jfinal.plugin.activerecord.Model;
 import com.jfinal.plugin.activerecord.Page;
 import com.jfinal.plugin.activerecord.Record;
+import com.mall.model.merchant.Merchant;
 import com.mall.util.DateUtil;
 import com.mall.util.Utility;
 import org.apache.commons.lang.ObjectUtils;
@@ -266,10 +267,20 @@ public class Product extends Model<Product>
         sql.append(" t.product_main_img,");
         sql.append(" (select ifnull(sum(a.product_qty),0) from user_order a,user_order_detail b where ");
         sql.append(" a.id =b.order_id and b.product_id = t.id and (order_status='20' or order_status='30' or order_status='40')) sale_num");
-        sql.append(" from product t where (t.product_type='10' or t.product_type='30')  and t.product_owner='10' and t.status='1' and t.time_status=0");
+        sql.append(" from product t where (t.product_type='10' or t.product_type='30')  and t.status='1' and t.time_status=0");
         if(StringUtils.isNotEmpty(id)){
         	sql.append(" and t.id !="+id);
-		}
+            Product product = this.findById(id);
+            Merchant merchant = Merchant.dao.findById(product.getInt("merchant_id"));
+            if("1".equals(merchant.get("is_shop"))){
+                sql.append(" and t.product_owner='20' and t.merchant_id ="+product.getInt("merchant_id"));
+            }else {
+                sql.append(" and t.product_owner='10'");
+            }
+		}else{
+            sql.append(" and t.product_owner='10'");
+        }
+
         sql.append(" order by t.is_hot desc, t.sort desc");
         sql.append(" limit 4");
         return find(sql.toString());

+ 4 - 4
src/config.properties

@@ -1,12 +1,12 @@
 #版本
-version=v1.0.40
+version=v1.0.44
 #数据库
 jdbcUrl = jdbc:mysql://127.0.0.1/buying?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull
 user = root
 password =ajj123321
 devMode = true
 #网站链接
-siteUrl=http://www.3water.cn/buyingtest
+siteUrl=http://www.3water.cn/buying
 #网站名称
 siteName=限时抢购
 #文件上传路径
@@ -17,5 +17,5 @@ imgUrl=http://www.3water.cn:8090/buying/
 token=xianshiqianggou
 appId=wxd8613a7025571df4
 appSecret=ba4af32817f3dee6bd3d389be9a96b00
-mchId=150520735188
-key=082f34fc28db4899bf4359dee9e5212900
+mchId=1505207351
+key=082f34fc28db4899bf4359dee9e52129