正在显示
2 个修改的文件
包含
22 行增加
和
37 行删除
@@ -182,7 +182,14 @@ class IndexController extends WeChatBaseController | @@ -182,7 +182,14 @@ class IndexController extends WeChatBaseController | ||
182 | public function search_salesman_goods(){ | 182 | public function search_salesman_goods(){ |
183 | 183 | ||
184 | $book_name = $_POST['book_name']; | 184 | $book_name = $_POST['book_name']; |
185 | - $data_salesman_goods = Db::name('goods') -> where("type =2 ") -> where('book_name','like',"%".$book_name."%") -> select(); | 185 | + $data_salesman_goods = Db::name('goods') -> alias('a') -> field("a.*,b.name") -> join('classification b','a.classify_id = b.id','LEFT') -> where("type =2 ") -> where('book_name','like',"%".$book_name."%") -> select(); |
186 | + if(!empty($data_salesman_goods)){ | ||
187 | + foreach ($data_salesman_goods as $key => $val){ | ||
188 | + $price = explode('.',$data_salesman_goods[$key]['price']); | ||
189 | + $data_salesman_goods[$key]['price0'] = $price[0]; | ||
190 | + $data_salesman_goods[$key]['price1'] = $price[1]; | ||
191 | + } | ||
192 | + } | ||
186 | $this -> assign('data_salesman_goods',$data_salesman_goods); | 193 | $this -> assign('data_salesman_goods',$data_salesman_goods); |
187 | return $this -> fetch(); | 194 | return $this -> fetch(); |
188 | 195 |
@@ -48,44 +48,22 @@ | @@ -48,44 +48,22 @@ | ||
48 | </div> | 48 | </div> |
49 | <!-- 搜索内容 --> | 49 | <!-- 搜索内容 --> |
50 | <div class="in_hot_shop se_con"> | 50 | <div class="in_hot_shop se_con"> |
51 | - <div class="in_hotLi"> | ||
52 | - <a href=""> | ||
53 | - <div class="in_hotImg"> | ||
54 | - <img src="__TMPL__/public/assets/images/9.png" alt=""> | ||
55 | - </div> | ||
56 | - <div class="in_hotText"> | ||
57 | - <div class="in_hotName txt-cut"><span>小学</span>小学英语五年级下 册好用不贵经济实...</div> | ||
58 | - <div class="in_cam_shopPrice"> | ||
59 | - <div class="in_hotPrice1">¥<span>265</span>.00</div> | ||
60 | - <div class="in_cam_shopY">¥200.00</div> | 51 | + <volist name="data_salesman_goods" id="vo"> |
52 | + <div class="in_hotLi"> | ||
53 | + <a href=""> | ||
54 | + <div class="in_hotImg"> | ||
55 | + <img src="{:cmf_image_get_url($vo.show_img)}" alt=""> | ||
61 | </div> | 56 | </div> |
62 | - </div> | ||
63 | - </a> | ||
64 | - </div> | ||
65 | - <div class="in_hotLi"> | ||
66 | - <div class="in_hotImg"> | ||
67 | - <img src="__TMPL__/public/assets/images/9.png" alt=""> | ||
68 | - </div> | ||
69 | - <div class="in_hotText"> | ||
70 | - <div class="in_hotName txt-cut"><span>小学</span>小学英语五年级下 册好用不贵经济实...</div> | ||
71 | - <div class="in_cam_shopPrice"> | ||
72 | - <div class="in_hotPrice1">¥<span>265</span>.00</div> | ||
73 | - <div class="in_cam_shopY">¥200.00</div> | ||
74 | - </div> | ||
75 | - </div> | ||
76 | - </div> | ||
77 | - <div class="in_hotLi"> | ||
78 | - <div class="in_hotImg"> | ||
79 | - <img src="__TMPL__/public/assets/images/9.png" alt=""> | ||
80 | - </div> | ||
81 | - <div class="in_hotText"> | ||
82 | - <div class="in_hotName txt-cut"><span>小学</span>小学英语五年级下 册好用不贵经济实...</div> | ||
83 | - <div class="in_cam_shopPrice"> | ||
84 | - <div class="in_hotPrice1">¥<span>265</span>.00</div> | ||
85 | - <div class="in_cam_shopY">¥200.00</div> | ||
86 | - </div> | 57 | + <div class="in_hotText"> |
58 | + <div class="in_hotName txt-cut"><span>{$vo.name}</span>{$vo.book_name}</div> | ||
59 | + <div class="in_cam_shopPrice"> | ||
60 | + <div class="in_hotPrice1">¥<span>{$vo.price0}</span>.{$vo.price1}</div> | ||
61 | + <div class="in_cam_shopY">¥{$vo.pricing}</div> | ||
62 | + </div> | ||
63 | + </div> | ||
64 | + </a> | ||
87 | </div> | 65 | </div> |
88 | - </div> | 66 | + </volist> |
89 | </div> | 67 | </div> |
90 | <!-- 底部更多 --> | 68 | <!-- 底部更多 --> |
91 | <div class="in_what">—— 已经到底了哦 ——</div> | 69 | <div class="in_what">—— 已经到底了哦 ——</div> |
-
请 注册 或 登录 后发表评论