Przeglądaj źródła

完善报名接口

15954078560 2 lat temu
rodzic
commit
0392486a9a

+ 5 - 0
application/admin/controller/Active.php

@@ -317,6 +317,11 @@ class Active extends Backend
         }
 
         Db::name('active')->delete($ids);
+        Db::name('active_order')->where(['active_id' => $ids])->delete();
+        Db::name('active_people')->where(['active_id' => $ids])->delete();
+        Db::name('active_people_modify')->where(['active_id' => $ids])->delete();
+        Db::name('active_refund')->where(['active_id' => $ids])->delete();
+
         $this->success();
     }
 }

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

@@ -158,6 +158,7 @@ class Index extends Api
         }
 
         $id = input('id', 0, 'intval'); //活动id
+        $collectionplace = input('collectionplace', '', 'trim'); //集合地点
         //人员信息json串:
         // name姓名 credtype证件类型 idcard身份证号 mobile手机号 emergencycontact紧急联系人 contactmobile紧急联系方式
         // insurance保险 originalprice原价  vipprice会员价 coupon_id用户优惠券ID is_free是否使用免费次数:0=否,1=是
@@ -166,6 +167,9 @@ class Index extends Api
         $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 (!preg_match('/^[0-9]+(.[0-9]{1,2})?$/', $total_price) || $total_price < 0) {
             $this->error('合计价格错误');
         }
@@ -475,6 +479,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['paytype'] = $paytype;
         $order_data['price'] = $total_amount;
         $order_data['number'] = count($active_people_arr);

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

@@ -35,6 +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: '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')},