Эх сурвалжийг харах

Merge branch 'master' of http://59.57.98.130:3000/jjhc/love

# Conflicts:
#	app/common/Fun.php
linwu 2 жил өмнө
parent
commit
207aef3475

+ 1 - 1
app/common/Constant.php

@@ -21,7 +21,7 @@ class Constant
 //    const TOPHOME = ['独生子女','老大','老二','老三','老四','老五','其他'];
 //    const WANTCHILD = ['愿意','不愿意','视情况而定'];
 //    const LIVEPARENT = ['愿意','不愿意','视情况而定'];
-    const ID_TYPE = ['公务员', '事业干部', '编外人员', '企业高管或职工'];
+    const ID_TYPE = ['公务员', '事业干部', '编外人员', '国企高管','职工'];
     const FAMILY  = ['爷爷', '奶奶', '外公', '外婆', '父亲', '母亲', '哥哥', '弟弟', '姐姐', '妹妹'];
 //    const TALENT_LEVEL = ['第一层次', '第二层次', '第三层次', '第四层次', '第五层次', '第六层次', '第七层次', '其他人才', '不是人才'];
     const NATIVE = ['晋江籍', '非晋江籍', '无要求'];

+ 4 - 5
app/common/Fun.php

@@ -69,12 +69,11 @@ class Fun
     /**
      * 是否手机号
      */
-    public static function isMobile($user_mobile)
-    {
-        $chars = "/^((\(\d{2,3}\))|(\d{3}\-))?1(3|5|8|9)\d{9}$/";
-        if (preg_match($chars, $user_mobile)) {
+    public static function isMobile($user_mobile){
+        $chars = "/^((\(\d{2,3}\))|(\d{3}\-))?1(3|4|5|6|7|8|9)\d{9}$/";
+        if (preg_match($chars, $user_mobile)){
             return true;
-        } else {
+        }else{
             return false;
         }
     }

+ 9 - 4
app/love/controller/MyController.php

@@ -451,7 +451,12 @@ class MyController extends LoveBaseController
         $id      = $this->request->post('id');
         $user_id = cmf_get_current_user_id();
         $user    = UserSelectModel::get(['user_id' => $user_id, 'uid' => $id]);
+        //20230423增加两个userid对调的查询,因为双方都有权利取消
+        if(empty($user)){
+            $user    = UserSelectModel::get(['user_id' => $id, 'uid' => $user_id]);
+        }
         if (!empty($user)) {
+            UserSelectLogModel::where('user_id1|user_id2', $id)->where('update_time',0)->order('id','desc')->update(['update_time'=>time()]);
             $user->delete();
         }
 
@@ -466,7 +471,7 @@ class MyController extends LoveBaseController
         $id      = $this->request->post('id');
         $user_id = cmf_get_current_user_id();
         $user    = UserSelectModel::get(['user_id' => $id, 'uid' => $user_id]);
-        $check   = UserSelectLogModel::where('user_id1|user_id2', $id)->find();
+        $check   = UserSelectLogModel::where('user_id1|user_id2', $id)->where('update_time',0)->find();
         if (!empty($check)) {
             $this->error('对方已被选择!');
         }
@@ -526,14 +531,14 @@ class MyController extends LoveBaseController
         UserMessageModel::create([
             'from_id'     => $user_id,
             'to_id'       => $id,
-            'message'     => '我已接受你的交往请求,请继续努力哦!',
+            'message'     => '我已接受你的交往请求,快来一起聊天吧!',
             'create_time' => $time,
         ]);
 
         //增加最后聊天消息
-        UserFriendModel::update(['last_msg' => '我:我已接受你的交往请求,请继续努力哦!', 'last_msg_time' => $time], ['user_id' => $user_id, 'friend_id' => $id]);
+        UserFriendModel::update(['last_msg' => '我:我已接受你的交往请求,快来一起聊天吧!', 'last_msg_time' => $time], ['user_id' => $user_id, 'friend_id' => $id]);
         $friend                = UserFriendModel::get(['user_id' => $id, 'friend_id' => $user_id]);
-        $friend->last_msg      = '对方:我已接受你的交往请求,请继续努力哦!';
+        $friend->last_msg      = '对方:我已接受你的交往请求,快来一起聊天吧!';
         $friend->last_msg_time = $time;
         $friend->unread_num++;
         $friend->save();

+ 4 - 4
app/user/controller/AdminUserController.php

@@ -27,10 +27,10 @@ class AdminUserController extends AdminBaseController
      */
     public function auth()
     {
+        $keyword = $this->request->param('keyword');
         $list = UserAuthModel::
-        where(function ($query) {
-            if (!empty($data['keyword'])) {
-                $keyword = $data['keyword'];
+        where(function ($query) use ($keyword) {
+            if (!empty($keyword)) {
                 $query->where('name|idcard|mobile', 'like', "%$keyword%");
             }
         })
@@ -39,7 +39,7 @@ class AdminUserController extends AdminBaseController
                 'query' => Request::param(),//不丢失已存在的url参数
             ]);
 
-        $this->assign('keyword', $this->request->param('keyword') ?: '');
+        $this->assign('keyword', $keyword ?: '');
 
         // 获取分页显示
         $page = $list->render();

+ 2 - 2
public/themes/admin_simpleboot3/user/admin_user/auth.html

@@ -6,9 +6,9 @@
 			<li class="active"><a href="{:url('adminUser/auth')}">允许注册列表</a></li>
 			<li><a href="{:url('adminUser/authAdd')}">添加注册名单</a></li>
 		</ul>
-        <form class="well form-inline margin-top-20" method="get" action="{:url('User/index')}">
+        <form class="well form-inline margin-top-20" method="get" action="{:url('adminUser/auth')}">
             关键字:
-            <input type="text" class="form-control" name="user_login" style="width: 240px;" value="{:input('request.user_login/s','')}" placeholder="请输入姓名/身份证/手机号">
+            <input type="text" class="form-control" name="keyword" style="width: 240px;" value="{:input('request.keyword/s','')}" placeholder="请输入姓名/身份证/手机号">
             <input type="submit" class="btn btn-primary" value="搜索" />
             <a class="btn btn-danger" href="{:url('adminUser/auth')}">清空</a>
         </form>

+ 13 - 0
public/themes/simpleboot3/love/my/profile.html

@@ -123,6 +123,14 @@
         ></van-picker>
     </van-popup>
 
+    <van-field
+            v-if="form.marry == '离异'"
+            required
+            v-model="form.children"
+            label="几个小孩"
+            placeholder="请输入您小孩数量"
+    ></van-field>
+
     <!--学历-->
     <van-field
             required
@@ -222,6 +230,7 @@
 
     <!--民族-->
     <van-field
+            required
             readonly
             clickable
             :value="form.nation"
@@ -440,6 +449,10 @@
                         this.$toast('请输入籍贯');
                         return false;
                     }
+                    if (this.form.nation == '') {
+                        this.$toast('请选择民族');
+                        return false;
+                    }
                     $.post("{:url('profilePost')}", this.form, function (json) {
                         history.back();
                     }, 'json');

+ 14 - 3
public/themes/simpleboot3/love/my/select.html

@@ -86,7 +86,8 @@
                 </p>
             </div>
             <div class="fr mr20">
-                <van-button type="primary" size="mini" @click="location.href = '{:url('Userwall/detail')}?id='+user.id">查看详情</van-button>
+                <van-button type="primary" size="mini" @click="location.href = '{:url('Userwall/detail')}?id='+user.id">查看详情</van-button><br />
+                <van-button type="danger" size="mini" @click.stop="cancel(user.id)">取消互选</van-button>
             </div>
             <div class="clear"></div>
         </div>
@@ -152,8 +153,13 @@
                         title: '确认关系',
                         message: '确认选择后将无法再选择其他人',
                     }).then(() => {
+                        var that = this;
                         $.post("{:url('selectConfirm')}",{id:id},function (json) {
-                            location.reload();
+                            if(json.code == 1){
+                                location.reload();
+                            }else{
+                                that.$toast(json.msg);
+                            }
                         });
                     }).catch(() => {
                         // on cancel
@@ -166,8 +172,13 @@
                         title: '取消选择',
                         message: '确认取消表明心意?',
                     }).then(() => {
+                        var that = this;
                         $.post("{:url('selectCancel')}",{id:id},function (json) {
-                            location.reload();
+                            if(json.code == 1){
+                                location.reload();
+                            }else{
+                                that.$toast(json.msg);
+                            }
                         });
                     }).catch(() => {
                         // on cancel

+ 13 - 0
public/themes/simpleboot3/love/register/profile.html

@@ -134,6 +134,14 @@
         ></van-picker>
     </van-popup>
 
+    <van-field
+            v-if="form.marry == '离异'"
+            required
+            v-model="form.children"
+            label="几个小孩"
+            placeholder="请输入您小孩数量"
+    ></van-field>
+
     <!--学历-->
     <van-field
             required
@@ -221,6 +229,7 @@
 
     <!--民族-->
     <van-field
+            required
             readonly
             clickable
             :value="form.nation"
@@ -444,6 +453,10 @@
                         this.$toast('请输入籍贯');
                         return false;
                     }
+                    if (this.form.nation == '') {
+                        this.$toast('请选择民族');
+                        return false;
+                    }
                     $.post("{:url('profile')}", this.form, function (json) {
                         location.href = "{:url('cond')}";
                     }, 'json');

+ 1 - 1
public/themes/simpleboot3/love/userwall/detail.html

@@ -151,7 +151,7 @@
             <van-cell title="工作单位" :value="user.company"></van-cell>
             <van-cell title="职务" :value="user.job"></van-cell>
             <van-cell title="身份类型" :value="user.id_type"></van-cell>
-            <van-cell title="家庭成" :value="user.family.toString()"></van-cell>
+            <van-cell title="家庭成" :value="user.family.toString()"></van-cell>
             <van-cell title="籍贯" :value="user.native"></van-cell>
             <van-cell title="民族" :value="user.nation"></van-cell>
             <van-cell title="兴趣爱好" :value="user.hobby"></van-cell>