商品收藏

feat/task1-c-wallet
gongfuxiang 2018-10-15 23:42:01 +08:00
parent c385c13bb1
commit f5284c28d4
3 changed files with 5 additions and 5 deletions

View File

@ -46,7 +46,7 @@
<tbody> <tbody>
<notempty name="data_list"> <notempty name="data_list">
<foreach name="data_list" item="v"> <foreach name="data_list" item="v">
<tr id="data-list-{{$v.id}}"> <tr id="data-list-{{$v.goods_id}}">
<td> <td>
<div class="goods-detail"> <div class="goods-detail">
<a href="{{$v.goods_url}}" target="_blank"> <a href="{{$v.goods_url}}" target="_blank">
@ -64,7 +64,7 @@
<p class="line-price">¥{{$v.price}}</p> <p class="line-price">¥{{$v.price}}</p>
</td> </td>
<td> <td>
<button type="button" class="am-btn am-btn-danger am-btn-xs am-radius am-btn-block submit-ajax" data-url="{{:U('Home/UserFavor/Cancel')}}" data-id="{{$v.id}}" data-view="reload">取消</button> <button type="button" class="am-btn am-btn-danger am-btn-xs am-radius am-btn-block submit-ajax" data-url="{{:U('Home/UserFavor/Cancel')}}" data-id="{{$v.goods_id}}" data-view="delete">取消</button>
</td> </td>
</tr> </tr>
</foreach> </foreach>

View File

@ -317,7 +317,7 @@ class GoodsService
[ [
'checked_type' => 'empty', 'checked_type' => 'empty',
'key_name' => 'id', 'key_name' => 'id',
'error_msg' => '删除数据id有误', 'error_msg' => '商品id有误',
], ],
[ [
'checked_type' => 'empty', 'checked_type' => 'empty',
@ -333,7 +333,7 @@ class GoodsService
// 开始操作 // 开始操作
$m = M('GoodsFavor'); $m = M('GoodsFavor');
$data = ['id'=>intval($params['id']), 'user_id'=>$params['user']['id']]; $data = ['goods_id'=>intval($params['id']), 'user_id'=>$params['user']['id']];
$temp = $m->where($data)->find(); $temp = $m->where($data)->find();
if(empty($temp)) if(empty($temp))
{ {

View File

@ -205,7 +205,7 @@ $(function() {
type: 'post', type: 'post',
dataType: "json", dataType: "json",
timeout: 10000, timeout: 10000,
data: {"goods_id": $('.goods-detail').data('id')}, data: {"id": $('.goods-detail').data('id')},
success: function(result) success: function(result)
{ {
poptit_close(); poptit_close();