Przeglądaj źródła

注册修改,新增生日,紧急联系人电话,居住地

lizhen_gitee 11 miesięcy temu
rodzic
commit
400d7a8c76

+ 4 - 2
application/admin/lang/zh-cn/user/user.php

@@ -44,8 +44,10 @@ return [
     'Whatsapp'          => 'whatsapp账号',
     'Knowus'            => '如何知道我们',
     'Health'            => '健康状况声明',
-    'Emergency'         => '紧急联系人姓名和联系号码',
+    'Emergency'         => '紧急联系人姓名',
+    'Emergency_phone'   => '紧急联系人联系号码',
     'Is_first'          => '是否上过课',
     'Is_first 0'        => '否',
-    'Is_first 1'        => '是'
+    'Is_first 1'        => '是',
+    'Residential'        => '居住地'
 ];

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

@@ -129,14 +129,14 @@ class User extends Api
 
         $countrycode = input('countrycode',65,'intval');
         $mobile      = input('mobile');
-        $captcha     = input('captcha');
+//        $captcha     = input('captcha');
 
         $email        = input('email');
         $emailcaptcha = input('emailcaptcha');
 
         $password     = input('password');
 
-        if (!$firstname || !$lastname || !$mobile || !$captcha  || !$email  || !$emailcaptcha || !$password) {
+        if (!$firstname || !$lastname || !$mobile || !$email  || !$emailcaptcha || !$password) {
             $this->error(__('Invalid parameters'));
         }
 
@@ -150,10 +150,10 @@ class User extends Api
 
 
         $fullmobile = $countrycode.$mobile;
-        $ret = Sms::check($fullmobile, $captcha, 'register');
+        /*$ret = Sms::check($fullmobile, $captcha, 'register');
         if (!$ret) {
             $this->error(__('Mobile Captcha is incorrect'));
-        }
+        }*/
 
         $ret = Ems::check($email, $emailcaptcha, 'register');
         if (!$ret) {
@@ -166,13 +166,16 @@ class User extends Api
             'simplemobile' => $mobile,
             'height'       => input('height',''),
             'age'          => input('age',''),
+            'birthday'     => strtotime(input('birthday','')),
             'weight'       => input('weight',''),
             'address'      => input('address',''),
             'knowus'       => input('knowus',''),
 
             'health'       => input('health',''),
             'emergency'    => input('emergency',''),
+            'emergency_phone'    => input('emergency_phone',''),
             'is_first'     => input('is_first',''),
+            'residential'     => input('residential',''),
         ];
         $ret = $this->auth->register('', $password, $email, $fullmobile, $extend);
         if ($ret) {
@@ -185,7 +188,7 @@ class User extends Api
 
     //注册配置,怎么知道我们
     public function register_config(){
-        $rs = [
+        $knowus = [
             'Facebook',
             'Instagram',
             'Family and Friends',
@@ -193,6 +196,18 @@ class User extends Api
             'Whatsapp',
             'Others',
         ];
+
+        $residential = [
+            '北部',
+            '东北部',
+            '东部',
+            '南部',
+            '西部',
+            '中部',
+        ];
+
+        $rs['knowus']     = $knowus;
+        $rs['residential'] = $residential;
         $this->success(1,$rs);
     }
 

+ 3 - 1
public/assets/js/backend/user/user.js

@@ -48,7 +48,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 
 //                        {field: 'level', title: __('Level')},
 //                        {field: 'gender', title: __('Gender')},
-//                        {field: 'birthday', title: __('Birthday')},
+                        {field: 'birthday', title: __('Birthday'),operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.date},
 //                        {field: 'bio', title: __('Bio'), operate: 'LIKE'},
 //                        {field: 'successions', title: __('Successions')},
 //                        {field: 'maxsuccessions', title: __('Maxsuccessions')},
@@ -67,7 +67,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'knowus', title: __('Knowus'), operate: 'LIKE'},
                         {field: 'health', title: __('Health'), operate: 'LIKE'},
                         {field: 'emergency', title: __('Emergency'), operate: 'LIKE'},
+                        {field: 'emergency_phone', title: __('Emergency_phone'), operate: 'LIKE'},
                         {field: 'is_first', title: __('Is_first'), searchList: {"0":__('Is_first 0'),"1":__('Is_first 1')}, formatter: Table.api.formatter.normal},
+                        {field: 'residential', title: __('Residential')},
 
                         {field: 'operate', title: __('Operate'), table: table,
                             buttons:[

+ 8 - 0
public/assets/js/require-table.js

@@ -804,6 +804,14 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
                 label: function (value, row, index) {
                     return Table.api.formatter.flag.call(this, value, row, index);
                 },
+                date: function (value, row, index) {
+                    var datetimeFormat = typeof this.datetimeFormat === 'undefined' ? 'YYYY-MM-DD' : this.datetimeFormat;
+                    if (isNaN(value)) {
+                        return value ? Moment(value).format(datetimeFormat) : __('None');
+                    } else {
+                        return value ? Moment(parseInt(value) * 1000).format(datetimeFormat) : __('None');
+                    }
+                },
                 datetime: function (value, row, index) {
                     var datetimeFormat = typeof this.datetimeFormat === 'undefined' ? 'YYYY-MM-DD HH:mm:ss' : this.datetimeFormat;
                     if (isNaN(value)) {