瀏覽代碼

完善后台活动人员信息修改

15954078560 2 年之前
父節點
當前提交
9f4fe53d8c

+ 6 - 0
application/admin/view/activepeoplemodify/edit.html

@@ -25,6 +25,12 @@
         </div>
     </div>-->
     <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('集合地点')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-collectionplace" data-rule="required" readonly class="form-control" name="row[collectionplace]" type="text" value="{$row.collectionplace|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
         <div class="col-xs-12 col-sm-8">
             <input id="c-name" data-rule="required" readonly class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">

+ 12 - 7
application/api/controller/Index.php

@@ -159,18 +159,18 @@ class Index extends Api
         }
 
         $id = input('id', 0, 'intval'); //活动id
-        $collectionplace = input('collectionplace', '', 'trim'); //集合地点
+//        $collectionplace = input('collectionplace', '', 'trim'); //集合地点
         //人员信息json串:
         // name姓名 credtype证件类型 idcard身份证号 mobile手机号 emergencycontact紧急联系人 contactmobile紧急联系方式
         // insurance保险 originalprice原价  vipprice会员价 coupon_id用户优惠券ID is_free是否使用免费次数:0=否,1=是
-        // price小计  is_self是否本人:0=否,1=是
+        // price小计  is_self是否本人:0=否,1=是  collectionplace集合地点
         $active_people = input('active_people', '', 'trim');
         $paytype = input('paytype', 0, 'intval'); //支付方式:0=余额,1=微信
         $total_price = input('total_price', 0, 'trim'); //总价格
 
-        if ($collectionplace === '' || iconv_strlen($collectionplace, 'utf-8') > 255) {
-            $this->error('请选择集合地点');
-        }
+//        if ($collectionplace === '' || iconv_strlen($collectionplace, 'utf-8') > 255) {
+//            $this->error('请选择集合地点');
+//        }
         if (!preg_match('/^[0-9]+(.[0-9]{1,2})?$/', $total_price) || $total_price < 0) {
             $this->error('合计价格错误');
         }
@@ -264,6 +264,11 @@ class Index extends Api
                 $this->error('保险信息错误');
                 break;
             }
+            //判断集合地点
+            if ($v['collectionplace'] === '' || iconv_strlen($v['collectionplace'] , 'utf-8') > 255) {
+                $this->error($v['name'] . '请选择集合地点');
+                break;
+            }
             //判断用户信息
             if ($v['is_self'] && $k == 0) {
                 //判断用户信息
@@ -455,7 +460,7 @@ class Index extends Api
 
             $data['active_id'] = $id;
             $data['user_id'] = $this->auth->id;
-            $data['collectionplace'] = $collectionplace;
+            $data['collectionplace'] = $v['collectionplace'];
             $data['credtype'] = $v['credtype'];
             $data['insurance'] = $v['insurance'];
             $data['originalprice'] = $info['price'];
@@ -481,7 +486,7 @@ class Index extends Api
         $order_data['order_sn'] = date('YmdHis', time()) . rand(10000000, 99999999);
         $order_data['active_id'] = $id;
         $order_data['user_id'] = $this->auth->id;
-        $order_data['collectionplace'] = $collectionplace;
+//        $order_data['collectionplace'] = $collectionplace;
         $order_data['paytype'] = $paytype;
         $order_data['price'] = $total_amount;
         $order_data['number'] = count($active_people_arr);

+ 5 - 0
application/api/controller/User.php

@@ -1741,6 +1741,7 @@ class User extends Api
     //修改报名人信息
     public function modifyactivepeople() {
         $id = input('id', 0, 'intval'); //报名人员id
+        $collectionplace = input('collectionplace', '', 'trim'); //集合地点
         $name = input('name', '', 'trim'); //姓名
         $idcard = input('idcard', '', 'trim'); //身份证号
         $mobile = input('mobile', '', 'trim'); //手机号
@@ -1780,6 +1781,9 @@ class User extends Api
             $this->error('您正在申请退款,暂不可修改信息');
         }
         //检查信息
+        if ($collectionplace === '' || iconv_strlen($collectionplace, 'utf-8') > 255) {
+            $this->error('请选择集合地点');
+        }
         if (!$name || iconv_strlen($name, 'utf-8') > 50) {
             $this->error('请输入正确姓名');
         }
@@ -1810,6 +1814,7 @@ class User extends Api
             'order_id' => $info['order_id'],
             'people_id' => $id,
             'user_id' => $info['user_id'],
+            'collectionplace' => $collectionplace,
             'name' => $name,
             'credtype' => $info['credtype'],
             'idcard' => $idcard,

+ 1 - 1
public/assets/js/backend/activeorder.js

@@ -35,7 +35,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'user_id', title: __('User_id')},
                         {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
                         {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'},
-                        {field: 'collectionplace', title: __('集合地点'), operate: 'LIKE'},
+                        // {field: 'collectionplace', title: __('集合地点'), operate: 'LIKE'},
                         {field: 'paytype', title: __('Paytype'), searchList: {"0":__('Paytype 0'),"1":__('Paytype 1')}, formatter: Table.api.formatter.normal},
                         {field: 'price', title: __('Price'), operate: 'LIKE'},
                         {field: 'number', title: __('Number')},

+ 1 - 0
public/assets/js/backend/activepeoplemodify.js

@@ -42,6 +42,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'activepeople.mobile', title: '原'+__('People.mobile'), operate: 'LIKE'},
                         {field: 'activepeople.emergencycontact', title: '原'+__('People.emergencycontact'), operate: 'LIKE'},
                         {field: 'activepeople.contactmobile', title: '原'+__('People.contactmobile'), operate: 'LIKE'},
+                        {field: 'collectionplace', title: __('集合地点'), operate: 'LIKE'},
                         {field: 'name', title: __('Name'), operate: 'LIKE'},
                         {field: 'credtype', title: __('Credtype'), operate: 'LIKE'},
                         {field: 'idcard', title: __('Idcard'), operate: 'LIKE'},