This commit is contained in:
devil_gong 2018-10-15 18:27:19 +08:00
parent 19bd390630
commit 1d753599c2
4 changed files with 14 additions and 15 deletions

View File

@ -88,7 +88,6 @@ class UserFavorController extends CommonController
{
// 开始处理
$params = $_POST;
$params['goods_id'] = isset($params['id']) ? $params['id'] : 0;
$params['user'] = $this->user;
$ret = GoodsService::GoodsFavor($params);
$this->ajaxReturn($ret['msg'], $ret['code'], $ret['data']);

View File

@ -83,7 +83,7 @@
<if condition="in_array($v['status'], [1,2,3])">
<li>
<a href="{{:U('Home/Order/Index', ['is_more'=>1, 'status'=>$v['status']])}}">
<i class="icon-1"></i>
<i class="icon-{{$v.status}}"></i>
<p>{{$v.name}}</p>
<notempty name="v.count">
<span class="am-badge am-badge-danger am-round">{{$v.count}}</span>
@ -93,7 +93,7 @@
<elseif condition="in_array($v['status'], [100])" />
<li>
<a href="{{:U('Home/Order/Index', ['is_more'=>1, 'is_comments'=>0, 'status'=>4])}}">
<i class="icon-1"></i>
<i class="icon-{{$v.status}}"></i>
<p>{{$v.name}}</p>
<notempty name="v.count">
<span class="am-badge am-badge-danger am-round">{{$v.count}}</span>

View File

@ -45,26 +45,26 @@
</thead>
<tbody>
<notempty name="data_list">
<foreach name="data_list" item="goods">
<tr id="data-list-{{$goods.goods_id}}">
<foreach name="data_list" item="v">
<tr id="data-list-{{$v.id}}">
<td>
<div class="goods-detail">
<a href="{{$goods.goods_url}}" target="_blank">
<img src="{{$goods.images}}">
<a href="{{$v.goods_url}}" target="_blank">
<img src="{{$v.images}}">
</a>
<div class="goods-base">
<a href="{{$goods.goods_url}}" target="_blank" class="goods-title">{{$goods.title}}</a>
<a href="{{$v.goods_url}}" target="_blank" class="goods-title">{{$v.title}}</a>
</div>
</div>
</td>
<td>
<if condition="$goods['original_price'] gt 0">
<p class="original-price">¥{{$goods.original_price}}</p>
<if condition="$v['original_price'] gt 0">
<p class="original-price">¥{{$v.original_price}}</p>
</if>
<p class="line-price">¥{{$goods.price}}</p>
<p class="line-price">¥{{$v.price}}</p>
</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="{{$goods.goods_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.id}}" data-view="reload">取消</button>
</td>
</tr>
</foreach>

View File

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