dever 3 years ago
parent
commit
4dd9ebd471

+ 11 - 1
app/act/database/info.php

@@ -206,6 +206,16 @@ return array
             'col' => 'name as name, id, id as value, "" as selected, "" as disabled|id',
         ),
 
-        
+        'getAll' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'state' => 1,
+            ),
+            'type' => 'all',
+            'order' => array('id' => 'asc'),
+            'col' => '*,id as value',
+        ),
     ),
 );

+ 22 - 65
app/goods/database/coupon.php

@@ -9,20 +9,9 @@ $type = array
 
 $method = array
 (
-    1 => '自提',
-    2 => '配送',
-    3 => '自提+配送',
-);
-
-$time = array
-(
-    3 => '3天',
-    7 => '7天',
-    15 => '15天',
-    30 => '30天',
-    90 => '90天',
-    182 => '182天',
-    365 => '365天',
+    1 => '通用券',
+    2 => '同城券',
+    3 => '门店券',
 );
 
 return array
@@ -31,9 +20,9 @@ return array
     'name' => 'coupon',
     # 显示给用户看的名称
     'lang' => '优惠券配置',
+    'method' => $method,
     # 后台菜单排序
     'order' => 100,
-    'time' => $time,
     # 数据结构
     'struct' => array
     (
@@ -78,25 +67,14 @@ return array
         'method'        => array
         (
             'type'      => 'int-11',
-            'name'      => '优惠券范围',
-            'default'   => '3',
-            'desc'      => '优惠券范围',
+            'name'      => '优惠券属性',
+            'default'   => '1',
+            'desc'      => '优惠券属性',
             'match'     => 'is_numeric',
-            //'update'    => 'radio',
+            'search'    => 'select',
+            'update'    => 'radio',
             'option'    => $method,
-        ),
-
-        'category'      => array
-        (
-            'type'      => 'varchar-500',
-            'name'      => '分类',
-            'default'   => '',
-            'desc'      => '分类',
-            'match'     => 'is_string',
-            'search'    => 'linkage',
-            //'update'    => 'linkage',
-            'option'    => Dever::url('api.get', 'category'),
-            //'list'      => 'Dever::load("category/api.string", "{category}")',
+            'list'      => true,
         ),
 
         'total_cash'      => array
@@ -124,27 +102,6 @@ return array
             //'list'      => true,
         ),
 
-        'day'        => array
-        (
-            'type'      => 'varchar-100',
-            'name'      => '有效期范围',
-            'default'   => '',
-            'desc'      => '有效期范围',
-            'match'     => 'is_string',
-            //'update'    => 'checkbox',
-            'option'    => $time,
-        ),
-
-        'num'      => array
-        (
-            'type'      => 'int-11',
-            'name'      => '默认发放数量',
-            'default'   => '10',
-            'desc'      => '默认发放数量',
-            'match'     => 'is_string',
-            'update'    => 'text',
-        ),
-
         'status'        => array
         (
             'type'      => 'int-11',
@@ -191,17 +148,6 @@ return array
         ),
     ),
 
-    # 更新表结构
-    'alter' => array
-    (
-        2 => array
-        (
-            array('update', 'total', 'total_cash', 'varchar-100 0 满减金额'),
-            //array('add', 'config', 'config', 'int-11 1 配置'),
-        ),
-        'version' => 2,
-    ),
-
     'manage' => array
     (
         
@@ -209,6 +155,17 @@ return array
 
     'request' => array
     (
-        
+        'getAll' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'method' => 'yes',
+                'state' => 1,
+            ),
+            'type' => 'all',
+            'order' => array('cash' => 'desc', 'id' => 'asc'),
+            'col' => '*,id as value',
+        ),
     ),
 );

+ 39 - 0
app/goods/lib/Coupon.php

@@ -0,0 +1,39 @@
+<?php
+
+namespace Goods\Lib;
+
+use Dever;
+
+class Coupon
+{
+    public function get_api()
+    {
+        $level_total = 2;
+
+        # 当前联动级别
+        $level_num = Dever::input('level_num');
+
+        # 一般为id
+        $level_id = Dever::input('level_id');
+
+        if ($level_num == 1) {
+            $method = Dever::db('goods/coupon')->config['method'];
+            foreach ($method as $k => $v) {
+            	if ($k != 1) {
+            		$data[] = array('value' => $k, 'name' => $v);
+            	}
+            }
+        } elseif ($level_num == 2) {
+            $data = Dever::db('goods/coupon')->getAll(array('method' => $level_id));
+        }
+
+        if (!$data) {
+            Dever::alert('error');
+        }
+
+
+        $result['level_total'] = $level_total;
+        $result['list'] = $data;
+        return $result;
+    }
+}

+ 11 - 8
app/mshop/src/My.php

@@ -225,6 +225,7 @@ class My extends Core
     # 营销活动 优惠券列表
     public function getCoupon()
     {
+        $this->data['method'] = Dever::db('goods/coupon')->config['method'];
         $this->data['coupon'] = Dever::db('goods/coupon')->select();
 
         if ($this->data['coupon']) {
@@ -244,6 +245,7 @@ class My extends Core
     # 营销活动 配置
     public function setCoupon()
     {
+        /*
         $coupon_city = Dever::input('coupon_city');
 
         if ($coupon_city) {
@@ -251,10 +253,10 @@ class My extends Core
             $update['coupon_city'] = $coupon_city;
             Dever::db('shop/info')->update($update);
         }
-
+        */
         $coupon = Dever::input('coupon');
 
-        //$coupon[] = array('id' => 1, 'day' => 7, 'num' => 10);
+        //$coupon[] = array('id' => 1, 'day' => 7, 'method' => 2, 'num' => 10);
 
         //print_r(Dever::json_encode($coupon));die;
 
@@ -263,16 +265,16 @@ class My extends Core
             foreach ($coupon as $k => $v) {
                 $info = Dever::db('shop/coupon')->find(array('shop_id' => $this->shop_id, 'coupon_id' => $v['id']));
                 $data = array();
+                $data['method'] = $v['method'];
+                $data['coupon_id'] = $v['id'];
+                $data['coupon'] = $v['method'] . ',' . $v['id'];
+                $data['day'] = $v['day'];
+                $data['num'] = $v['num'];
                 if (!$info) {
                     $data['shop_id'] = $this->shop_id;
-                    $data['coupon_id'] = $v['id'];
-                    $data['day'] = $v['day'];
-                    $data['num'] = $v['num'];
                     Dever::db('shop/coupon')->insert($data);
                 } else {
                     $data['where_id'] = $info['id'];
-                    $data['day'] = $v['day'];
-                    $data['num'] = $v['num'];
                     Dever::db('shop/coupon')->update($data);
                 }
             }
@@ -284,11 +286,12 @@ class My extends Core
     # 获取参与活动领取的优惠券
     public function getActCoupon()
     {
+        $act_id = Dever::input('act_id', 1);
         $this->data['shop_coupon'] = Dever::load('shop/lib/coupon')->getData($this->shop_id);
 
         foreach ($this->data['shop_coupon'] as $k => $v) {
             $this->data['shop_coupon'][$k]['info'] = Dever::db('goods/coupon')->find($v['coupon_id']);
-            $check = Dever::db('shop/coupon_act_1')->find(array('shop_id' => $this->shop_id, 'shop_coupon_id' => $v['id']));
+            $check = Dever::db('shop/coupon_act')->find(array('shop_id' => $this->shop_id, 'shop_coupon_id' => $v['id'], 'act_id' => $act_id));
             $this->data['shop_coupon'][$k]['check'] = 1;
             if ($check) {
                 $this->data['shop_coupon'][$k]['act_coupon'] = $check;

+ 48 - 19
app/shop/database/coupon.php

@@ -2,18 +2,18 @@
 
 $shop_id = Dever::input('search_option_shop_id');
 
-$coupon = function()
-{
-    $array = array();
-    $info = Dever::db('goods/coupon')->select();
-    
-    if($info)
-    {
-        $array += $info;
-    }
-    return $array;
-};
-$time = Dever::db('goods/coupon')->config['time'];
+$method = Dever::db('goods/coupon')->config['method'];
+
+$time = array
+(
+    3 => '3天',
+    7 => '7天',
+    15 => '15天',
+    30 => '30天',
+    90 => '90天',
+    182 => '182天',
+    365 => '365天',
+);
 
 return array
 (
@@ -22,7 +22,13 @@ return array
     # 显示给用户看的名称
     'lang' => '优惠券设置',
     'menu' => false,
-    'check' => 'shop_id,coupon_id',
+    'time' => $time,
+    'check' => 'shop_id,coupon',
+    'end' => array
+    (
+        'insert' => 'shop/lib/manage.couponUpdate',
+        'update' => 'shop/lib/manage.couponUpdate',
+    ),
     # 数据结构
     'struct' => array
     (
@@ -51,15 +57,38 @@ return array
             'list'      => 'Dever::load("shop/info-find#name", {shop_id})',
         ),
 
+        'coupon'       => array
+        (
+            'type'      => 'varchar-500',
+            'name'      => '优惠券',
+            'default'   => '',
+            'desc'      => '优惠券',
+            'match'     => 'option',
+            //'search'    => 'linkage',
+            'update'    => 'linkage',
+            'option'    => Dever::url('lib/coupon.get', 'goods'),
+        ),
+
+        'method'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '优惠券属性',
+            'default'   => '',
+            'desc'      => '优惠券属性',
+            'match'     => 'option',
+            'search'    => 'select',
+            //'update'    => 'select',
+            'option'    => $method,
+            'list'      => true,
+        ),
+
         'coupon_id'      => array
         (
             'type'      => 'int-11',
             'name'      => '优惠券',
             'default'   => '',
             'desc'      => '优惠券',
-            'match'     => 'is_numeric',
-            'update'    => 'select',
-            'option'    => $coupon,
+            'match'     => 'option',
             'list'      => 'Dever::load("goods/coupon-find#name", {coupon_id})',
         ),
 
@@ -77,8 +106,8 @@ return array
         'day'        => array
         (
             'type'      => 'int-11',
-            'name'      => '有效期-请填写天数',
-            'default'   => '1',
+            'name'      => '有效期-请选择天数',
+            'default'   => '7',
             'desc'      => '有效期',
             'match'     => 'is_numeric',
             'update'    => 'select',
@@ -134,7 +163,7 @@ return array
     (
         'button' => array
         (
-            '分享领取优惠券活动设置' => array('fast', 1, 'coupon_act_1&where_id='.$shop_id.'&search_option_shop_id='.$shop_id),
+            //'分享领取优惠券活动设置' => array('fast', 1, 'coupon_act_1&where_id='.$shop_id.'&search_option_shop_id='.$shop_id),
         ),
     ),
 

+ 14 - 3
app/shop/database/coupon_act_1.php → app/shop/database/coupon_act.php

@@ -17,7 +17,7 @@ $coupon = function() use($shop_id)
 return array
 (
     # 表名
-    'name' => 'coupon_act_1',
+    'name' => 'coupon_act',
     # 显示给用户看的名称
     'lang' => '活动优惠券设置',
     'menu' => false,
@@ -49,6 +49,17 @@ return array
             'list'      => 'Dever::load("shop/info-find#name", {shop_id})',
         ),
 
+        'act_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '活动名称',
+            'default'   => '',
+            'desc'      => '活动名称',
+            'match'     => 'is_numeric',
+            'update'    => 'select',
+            'list'      => 'Dever::load("act/info-find#name", {act_id})',
+        ),
+
         'shop_coupon_id'      => array
         (
             'type'      => 'varchar-500',
@@ -96,7 +107,7 @@ return array
             'option' => array
             (
                 'shop_id' => 'yes',
-                'shop_coupon_id' => 'yes',
+                'act_id' => 'yes',
                 'state' => 1,
             ),
             'type' => 'all',
@@ -110,7 +121,7 @@ return array
             'option' => array
             (
                 'shop_id' => 'yes',
-                'shop_coupon_id' => 'yes',
+                'act_id' => 'yes',
                 'state' => 1,
             ),
             'type' => 'one',

+ 22 - 12
app/shop/database/info.php

@@ -15,14 +15,24 @@ $type = array
 
 $act = function()
 {
-    $array = array();
     $info = Dever::db('act/info')->select();
     
-    if($info)
-    {
-        $array += $info;
+    $id = Dever::input('where_id');
+    $coupon = Dever::db('shop/coupon')->select(array('shop_id' => $id));
+    if ($coupon) {
+        foreach ($coupon as $k => $v) {
+            $coupon_info = Dever::db('goods/coupon')->find($v['coupon_id']);
+            $prefix = '('.Dever::db('goods/coupon')->config['method'][$coupon_info['method']].')';
+            $coupon[$k]['name'] = $prefix . $coupon_info['name'];
+        }
     }
-    return $array;
+    foreach ($info as $k => $v) {
+        if ($v['id'] == 1) {
+            $info[$k]['child'] = $coupon;
+        }
+    }
+    $info['state'] = 2;//1是无需记录上级id,字符串逗号隔开。2是需要记录上级id,json格式
+    return $info;
 };
 
 $yes = array
@@ -442,24 +452,24 @@ return array
         'coupon_city'        => array
         (
             'type'      => 'int-11',
-            'name'      => '优惠券是否同城可用',
+            'name'      => '优惠券是否同城可用-废弃',
             'default'   => '2',
             'desc'      => '优惠券是否同城可用',
             'match'     => 'is_numeric',
             'update'    => 'radio',
-            'update'    => Dever::input('col') ? 'radio' : false,
+            //'update'    => Dever::input('col') ? 'radio' : false,
             'option'    => $yes,
         ),
 
-        'act'        => array
+        'act'       => array
         (
-            'type'      => 'varchar-500',
+            'type'      => 'text-255',
             'name'      => '参与活动',
             'default'   => '',
             'desc'      => '参与活动',
-            'match'     => 'is_numeric',
+            'match'     => 'option',
             'update'    => 'checkbox',
-            'update'    => Dever::input('col') ? 'checkbox' : false,
+            'data'      => 'parent',
             'option'    => $act,
         ),
 
@@ -521,7 +531,7 @@ return array
 
             'add13' => array('分配仓库', '"info&where_id={id}&col=store&oper_save_jump=info&oper_table=info&oper_parent=info"'),
 
-            'fast' => array('设置活动', '"info&where_id={id}&col=coupon_city,act&oper_save_jump=info&oper_table=info&oper_parent=info"'),
+            'fast' => array('设置活动', '"info&where_id={id}&col=act&oper_save_jump=info&oper_table=info&oper_parent=info"'),
 
             'br1' => array('<br /><br />'),
 

+ 2 - 2
app/shop/database/user_coupon.php

@@ -162,7 +162,7 @@ return array
                 'state' => 1,
             ),
             'type' => 'all',
-            'order' => array('status' => 'asc','edate' => 'asc', 'id' => 'desc'),
+            'order' => array('status' => 'asc','edate' => 'asc','cash' => 'desc', 'id' => 'desc'),
             'col' => '*',
         ),
 
@@ -180,7 +180,7 @@ return array
             ),
             'type' => 'all',
             'page' => array(10, 'list'),
-            'order' => array('status' => 'asc','edate' => 'asc', 'id' => 'desc'),
+            'order' => array('status' => 'asc','edate' => 'asc','cash' => 'desc', 'id' => 'desc'),
             'col' => '*',
         ),
     ),

+ 4 - 4
app/shop/lib/Coupon.php

@@ -22,9 +22,9 @@ class Coupon
     }
 
     # 获取分享活动的优惠券列表
-    public function getAll($shop_id)
+    public function getAll($shop_id, $act_id)
     {
-        $data = Dever::db('shop/coupon_act_1')->getData(array('shop_id' => $shop_id));
+        $data = Dever::db('shop/coupon_act')->getData(array('shop_id' => $shop_id, 'act_id' => $act_id));
 
         if ($data) {
         	foreach ($data as $k => $v) {
@@ -49,13 +49,13 @@ class Coupon
     }
 
     # 验证是否可以领取
-    public function getOne($uid, $shop, $shop_coupon_id, $num = 1, $act = true)
+    public function getOne($uid, $shop, $shop_coupon_id, $act_id = 1, $num = 1, $act = true)
     {
         if (!$shop_coupon_id) {
             return false;
         }
         if ($act) {
-            $data = Dever::db('shop/coupon_act_1')->getOne(array('shop_id' => $shop['id'], 'shop_coupon_id' => $shop_coupon_id));
+            $data = Dever::db('shop/coupon_act')->getOne(array('shop_id' => $shop['id'], 'act_id' => $act_id, 'shop_coupon_id' => $shop_coupon_id));
 
             if (!$data) {
                 return false;

+ 44 - 0
app/shop/lib/Manage.php

@@ -37,6 +37,34 @@ class Manage
         return Dever::table($table);
     }
 
+    /**
+     * 更新信息
+     *
+     * @return mixed
+     */
+    public function couponUpdate($id, $name, $data)
+    {
+        Dever::config('base')->hook = true;
+        $update = array();
+        $coupon = Dever::param('coupon', $data);
+        if ($coupon) {
+            $temp = is_string($coupon) ? explode(',', $coupon) : $coupon;
+            $update['method'] = $temp[0];
+            $update['coupon_id'] = $temp[1];
+        }
+
+        $shop_id = Dever::param('shop_id', $data);
+        if ($shop_id) {
+            $shop = Dever::db('shop/info')->find($shop_id);
+            $update['city'] = $shop['city'];
+        }
+
+        if (isset($update) && $update) {
+            $update['where_id'] = $id;
+            Dever::db('shop/coupon')->update($update);
+        }
+    }
+
     /**
      * 更新信息
      *
@@ -67,6 +95,22 @@ class Manage
             }
         }
 
+        $act = Dever::param('act', $data);
+        if ($act) {
+            foreach ($act as $k => $v) {
+                $w = array();
+                $w['shop_id'] = $id;
+                $w['act_id'] = $k;
+                foreach ($v as $k1 => $v1) {
+                    $w['shop_coupon_id'] = $v1;
+                    $info = Dever::db('shop/coupon_act')->find($w);
+                    if (!$info) {
+                        Dever::db('shop/coupon_act')->insert($w);
+                    }
+                }
+            }
+        }
+
         Dever::upLinkage($update, $id, $data, 'goods', 'shop/goods', 'shop_id', 'goods_id', 'category_id');
         Dever::upLinkage($update, $id, $data, 'factory', 'shop/factory', 'shop_id', 'factory_id', 'city');
         Dever::upLinkage($update, $id, $data, 'store', 'shop/store', 'shop_id', 'store_id', 'city');

+ 30 - 18
app/shop/lib/Sell.php

@@ -91,12 +91,20 @@ class Sell
         (
             array('value' => 1, 'name' => '待支付'),
             array('value' => 2, 'name' => '待处理'),
-            array('value' => 3, 'name' => '待自提'),
-            array('value' => 3, 'name' => '配送中'),
-            array('value' => '6,7,8', 'name' => '退款'),
-            array('value' => 4, 'name' => '已完成'),
-            array('value' => 5, 'name' => '已取消'),
         );
+        if ($method == 1) {
+            $result['search']['status'][] = array('value' => 3, 'name' => '待自提');
+        } elseif ($method == 2) {
+            $result['search']['status'][] = array('value' => 3, 'name' => '配送中');
+        } else {
+            $result['search']['status'][] = array('value' => 3, 'name' => '待自提');
+            $result['search']['status'][] = array('value' => 3, 'name' => '配送中');
+        }
+        $result['search']['status'][] = array('value' => '6,7,8', 'name' => '退款');
+        $result['search']['status'][] = array('value' => 4, 'name' => '已完成');
+        $result['search']['status'][] = array('value' => 5, 'name' => '已取消');
+
+
         $result['search']['method'] = array
         (
             array('value' => 1, 'name' => '自提'),
@@ -379,6 +387,7 @@ class Sell
         $data['coupon_cash'] = 0;
 
         if ($type == 1 && isset($data['uid']) && $data['uid'] > 0) {
+            # 默认选择优惠券
             if ($data['price'] <= 0) {
                 Dever::alert('付款价格错误');
             }
@@ -387,14 +396,13 @@ class Sell
 
             if ($coupon) {
                 foreach ($coupon as $k => $v) {
-                    if ($v['shop_id'] != $data['shop']['id']) {
-                        # 查找该券是否符合当前店铺
-                        if ($data['shop']['coupon_city'] == 2) {
+                    $coupon_info = Dever::db('goods/coupon')->find($v['coupon_id']);
+                    if ($coupon_info) {
+                        if ($v['shop_id'] != $data['shop']['id'] && $coupon_info['method'] == 3) {
+                            # 门店专属券 不能给别的门店用
                             continue;
                         }
-                    }
-                    $coupon_info = Dever::db('goods/coupon')->find($v['coupon_id']);
-                    if ($coupon_info && ($coupon_info['method'] == $data['method'] || $coupon_info['method'] == 3)) {
+
                         $kou = false;
                         if ($coupon_info['type'] == 1) {
                             # 满减券
@@ -424,6 +432,7 @@ class Sell
         }
 
         if ($user_coupon_id && isset($data['uid']) && $data['uid'] > 0) {
+            # 用户自己使用优惠券
             if ($data['price'] <= 0) {
                 Dever::alert('付款价格错误');
             }
@@ -436,8 +445,13 @@ class Sell
                 Dever::alert('优惠券已过期');
             }
 
+            $goods_coupon = Dever::db('goods/coupon')->find($coupon['coupon_id']);
+            if (!$goods_coupon) {
+                Dever::alert('优惠券不可用');
+            }
+
             if ($coupon['shop_id'] != $data['shop']['id']) {
-                if ($data['shop']['coupon_city'] == 2) {
+                if ($goods_coupon['method'] == 3) {
                     Dever::alert('优惠券不可用');
                 } else {
                     $coupon_info = Dever::db('shop/coupon')->find(array('shop_id' => $coupon['shop_id'], 'coupon_id' => $coupon['coupon_id'], 'city' => $coupon['city']));
@@ -447,18 +461,15 @@ class Sell
                 }
             }
 
-            $goods_coupon = Dever::db('goods/coupon')->find($coupon['coupon_id']);
             if ($goods_coupon['type'] == 2 && $data['price'] < $goods_coupon['total_cash']) {
                 Dever::alert('优惠券不可用');
             }
-            if ($goods_coupon['method'] != $data['method'] && $goods_coupon['method'] != 3) {
-                Dever::alert('优惠券不可用');
-            }
 
             $data['user_coupon_id'] = $user_coupon_id;
             $data['coupon_id'] = $goods_coupon['id'];
             $data['coupon_cash'] = $goods_coupon['cash'];
         } elseif ($coupon_id && $type == 3) {
+            # 店里直接给用优惠券
             if ($data['price'] <= 0) {
                 Dever::alert('付款价格错误');
             }
@@ -468,10 +479,11 @@ class Sell
             }
 
             $goods_coupon = Dever::db('goods/coupon')->find($coupon_info['coupon_id']);
-            if ($goods_coupon['type'] == 2 && $data['price'] < $goods_coupon['total_cash']) {
+            if (!$goods_coupon) {
                 Dever::alert('优惠券不可用');
             }
-            if ($goods_coupon['method'] != $data['method'] && $goods_coupon['method'] != 3) {
+
+            if ($goods_coupon['type'] == 2 && $data['price'] < $goods_coupon['total_cash']) {
                 Dever::alert('优惠券不可用');
             }
 

+ 5 - 4
app/shop/src/Buy.php

@@ -37,11 +37,11 @@ class Buy extends Core
 	# 获取店铺的优惠券
 	public function getCoupon()
 	{
-		$this->data['coupon'] = Dever::load('shop/lib/coupon')->getAll($this->shop_id);
+		$act_id = Dever::input('act_id', 1);
 
-		$this->data['shop'] = $this->shop;
+		$this->data['coupon'] = Dever::load('shop/lib/coupon')->getAll($this->shop_id, $act_id);
 
-		$act_id = Dever::input('act_id', 1);
+		$this->data['shop'] = $this->shop;
 
 		$this->data['act'] = Dever::db('act/info')->find($act_id);
 
@@ -51,6 +51,7 @@ class Buy extends Core
 	# 领取优惠券 也得判断一下用户是否有权限领取
 	public function takeCoupon()
 	{
+		$act_id = Dever::input('act_id', 1);
 		# 验证这个券是否可以领取
 		$shop_coupon_id = Dever::input('shop_coupon_id');
 		$coupon = explode(',', $shop_coupon_id);
@@ -58,7 +59,7 @@ class Buy extends Core
 		$this->data['take'] = array();
 		foreach ($coupon as $k => $v) {
 			$this->data['take']['shop_coupon_id'] = $v;
-			$this->data['take']['status'] = Dever::load('shop/lib/coupon')->getOne($this->uid, $this->shop, $v);
+			$this->data['take']['status'] = Dever::load('shop/lib/coupon')->getOne($this->uid, $this->shop, $v, $act_id);
 		}
 
 		return $this->data;