如果你对该文章中的内容有疑问/不解,可以点击此处链接提问
要注明问题和此文章链接地址 点击此处跳转
1
$q1 = "'%$q1%'"; $goods = M("goods"); $goodslist = $goods ->alias("g") ->join("shopping_goodsimg i on g.id = i.goods_id") ->where("i.is_main=1 and g.is_show=1 AND g.name like $q1") ->field(array("g.id", "g.name", "g.price", "g.num", "g.sales_num", "g.is_show", "g.is_new", "g.is_hot","g.is_integral", "g.is_coupon", "g.special_id", "g.seckill_id", "g.integral_price","g.category_id", "i.img")) ->select();
2
$Model = new \Think\Model(); $list = $Model->table('shopping_coupon AS c,shopping_user_coupon AS uc')->where('c.id = uc.coupon_id')->select();