正在显示
1 个修改的文件
包含
5 行增加
和
13 行删除
@@ -1799,22 +1799,14 @@ class User extends Api | @@ -1799,22 +1799,14 @@ class User extends Api | ||
1799 | $where['status'] = ['eq',2]; | 1799 | $where['status'] = ['eq',2]; |
1800 | 1800 | ||
1801 | if(!empty($video['id']) && !empty($video['attr'])){ | 1801 | if(!empty($video['id']) && !empty($video['attr'])){ |
1802 | + $video_s = serialize($video); | ||
1802 | //查看该图片或者该视频属性是否已经购买过 | 1803 | //查看该图片或者该视频属性是否已经购买过 |
1803 | $res = Db::name('iphone') | 1804 | $res = Db::name('iphone') |
1804 | ->where($where) | 1805 | ->where($where) |
1805 | - ->field('video_id') | ||
1806 | - ->select(); | ||
1807 | - foreach ($res as &$v){ | ||
1808 | - $v['video_id'] = unserialize($v['video_id']); | ||
1809 | - if(!empty($v['video_id']) && !empty($video)){ | ||
1810 | - foreach ($v['video_id'] as $v1){ | ||
1811 | - foreach ($video as &$v2){ | ||
1812 | - if($v1['id'] == $v2['id'] && $v1['attr'] == $v2['attr']){ | ||
1813 | - $this->error(['code'=>2,'msg'=>'该属性的视频已经购买过了','video_id'=>$v2['id']]); | ||
1814 | - } | ||
1815 | - } | ||
1816 | - } | ||
1817 | - } | 1806 | + ->where('video_id',$video_s) |
1807 | + ->find(); | ||
1808 | + if(!empty($res)){ | ||
1809 | + $this->error(['code'=>2,'msg'=>'该属性的视频已经购买过了']); | ||
1818 | } | 1810 | } |
1819 | $param['video_id'] = serialize($video); | 1811 | $param['video_id'] = serialize($video); |
1820 | }else{ | 1812 | }else{ |
-
请 注册 或 登录 后发表评论