north 7 gadi atpakaļ
vecāks
revīzija
c6b6324359

+ 3 - 1
www/protected/modules/j/controllers/JRecordController.php

@@ -22,7 +22,9 @@
          if (empty($coupon) || $coupon->status >= 2) {
              CommonFn::requestAjax(false,'兑换券不存在或已失效');exit;
          }
-
+         if ($coupon->status == 1) {
+             CommonFn::requestAjax(false,'兑换券已使用');exit;
+         }
          $record = new JRecord();
          $record->user_info = array(
              'name' => $name,

+ 2 - 0
www/protected/modules/j/models/JRecord.php

@@ -59,6 +59,7 @@ class JRecord extends MongoAr
         $newRow['id'] = (string)$row['_id'];
         $newRow['coupon_id'] = (string)$row['coupon_id'];
         $coupon = JCoupon::get(new MongoId($newRow['coupon_id']));
+        $newRow['coupon_coding'] = $coupon->coupon_coding;
         $gift = Gift::get(new MongoId((string)$coupon->gift_id));
         $newRow['pwd'] = $coupon->pwd;
         $newRow['gift_name'] = $gift->title;
@@ -67,6 +68,7 @@ class JRecord extends MongoAr
         $newRow['user_info'] = CommonFn::get_val_if_isset($row,'user_info','');
         $newRow['name'] = $newRow['user_info']['name'];
         $newRow['mobile'] = $newRow['user_info']['mobile'];
+
         $newRow['flow'] = CommonFn::get_val_if_isset($row,'flow','');
         $newRow['flow_number'] = CommonFn::get_val_if_isset($row,'flow_number','');
         $newRow['status'] = CommonFn::get_val_if_isset($row,'status','');

+ 1 - 1
www/protected/views/jRecord/index.php

@@ -501,7 +501,7 @@
       columns:[[
         {field:'id', title:'id', hidden:true},
         {field:'gift_name', title:'礼包名称', },
-        {field:'gift_id', title:'礼包编号',},
+        {field:'coupon_coding', title:'礼券编号',},
         {field:'pwd', title:'提货密码', formatter: function(value, row){
             return   '******';
           }},