Kaynağa Gözat

企业实名认证

Jonlin 6 yıl önce
ebeveyn
işleme
b3db390bb4

+ 89 - 1
application/user/controller/Certification.php

@@ -37,7 +37,7 @@ class Certification extends UserControl
     }
 
     /**
-     * 个人实名认证信息
+     * 个人实名认证
      * @return mixed
      */
     public function personal()
@@ -118,4 +118,92 @@ class Certification extends UserControl
     }
 
 
+    /**
+     * 企业实名认证
+     * @return mixed
+     */
+    public function enterprise()
+    {
+        $user_info = $this->getAdminInfo();
+        if (request()->isPost()) {
+            $enterprise = input('post.enterprise');
+            $area = input('post.area');
+            $enterprise_location = input('post.enterprise_location');
+            $enterprise_address = input('post.enterprise_address');
+            $contact_name = input('post.contact_name');
+            $whether = input('post.whether');
+            $credit_code = input('post.credit_code');
+            $bank_location = input('post.bank_location');
+            $bank = input('post.bank');
+            $bankbranch = input('post.bankbranch');
+            $debit_card = input('post.debit_card');
+            $ch_box = input('post.ch_box');
+
+            // 协议 校验
+            if ($ch_box == false) {
+                //验证失败
+                $this->error('未勾选协议');
+            }
+
+            $update_info = array(
+                'enterprise' => $enterprise,
+                'area' => $area,
+                'enterprise_location' => $enterprise_location,
+                'enterprise_address' => $enterprise_address,
+                'contact_name' => $contact_name,
+                'whether' => $whether,
+                'credit_code' => $credit_code,
+                'bank_location' => $bank_location,
+                'bank' => $bank,
+                'bankbranch' => $bankbranch,
+                'userInfo_debit_card' => $debit_card
+            );
+
+            $imgurl = DS_THEME_STYLE_URL . 'images/certification';
+            $numurl = '/static/user/images/certification';
+            $file = request()->file('images');
+//            print_r($file->getInfo());
+//            echo $file->getInfo()['name'];
+            if($file){
+                $imgname = $file->getInfo()['name'];
+                $file = $file->setSaveName($imgname);
+                $imgo = $file->move($imgurl, $savename = $imgname, $replace = true);
+                if($imgo){
+                    $update_info['businesslicense'] = $numurl.'/'.$imgname;
+                }
+            }
+//            print_r($update_info);
+            $date = array(
+                'user_status' => 0
+            );
+            $res = db('userinfo')->where('user_id', $user_info['user_id'])->update($update_info);
+            $result = db('user')->where('user_id', $user_info['user_id'])->update($date);
+            return $this->redirect('User/Certification/index');
+
+        }else{
+            $user = db('user')->where('user_email',$user_info['user_email'])->find();
+            $userinfo = db('userinfo')->where('user_id',$user_info['user_id'])->find();
+            if($user['user_status'] ==1){
+                $user['user_status_cn'] = '已实名认证';
+            }
+            if($user['user_status'] ==-1){
+                $user['user_status_cn'] = '未实名认证';
+            }
+            if($user['user_status'] ==0){
+                $user['user_status_cn'] = '实名认证中';
+            }
+
+            if($user['user_type'] ==1){
+                $user['user_type_cn'] = '个人用户';
+            }
+            if($user['user_type'] ==2){
+                $user['user_type_cn'] = '企业用户';
+            }
+            $this->assign('user', $user);
+            $this->assign('userinfo', $userinfo);
+            return $this->fetch();
+        }
+    }
+
+
 }

+ 222 - 0
application/user/view/certification/enterprise.html

@@ -0,0 +1,222 @@
+{extend name="layout:home" /}
+{block name="container"}
+<style>
+    .information{
+        margin-left: 100px;
+        margin-top: 40px;
+    }
+    table{
+        margin-left: 100px;
+        margin-top: 10px;
+    }
+    .td_info{
+        width: 180px;
+        height: 60px;
+        line-height: 60px;
+    }
+    .td_user_info{
+        width: 500px;
+        height: 60px;
+        line-height: 60px;
+    }
+    table .user_info>input{
+        border: 1px #aaa solid;
+        border-radius: 2px;
+        height: 30px;
+        width: 210px;
+        line-height:30px ;
+    }
+    .picture td{
+        height: 180px;
+    }
+    div.images{
+        width: 180px;
+        height: 140px;
+        border: 1px #aaa solid;
+    }
+    td.address input{
+        width: 60px;
+        margin-left: 10px;
+        background-color: white;
+        text-align: center;
+    }
+    td.images>div{
+        float: left;
+    }
+    td.images>div>div{
+        height: 30px;
+        line-height:30px ;
+        font-size: 10px;
+    }
+</style>
+<div class="layui-tab layui-tab-card">
+    <form method="post" enctype="multipart/form-data">
+        <div class="information">
+            <div style="color:dodgerblue;">请务必保证您填写的信息准确无误,否则有可能造成认证失败</div>
+        </div>
+        <div class="info">
+            <table>
+                <tr>
+                    <td class="td_info">企业名称</td>
+                    <td class="td_user_info user_info"><input type="text" name="enterprise" required="required" placeholder="请输入企业名称" value="{$userinfo['enterprise']}"></td>
+                </tr>
+                <tr>
+                    <td class="td_info">企业通讯地址</td>
+                    <td class="td_user_info user_info address">
+                        <input style="margin-left: 0;" readonly="readonly" type="text" id="china" value="中国大陆">
+                        <input type="text" readonly="readonly" id="gangaotai" value="港澳台">
+                        <input type="text" readonly="readonly" id="overseas" value="海外">
+                        <input type="text"style="display: none;" id="hidden" value="{$userinfo['area']}">
+                    </td>
+                </tr>
+                <tr>
+                    <td class="td_info"></td>
+                    <td class="td_user_info user_info"><input type="text" name="enterprise_location" required="required" placeholder="请输入公司所在地" value="{$userinfo['enterprise_location']}"></td>
+                </tr>
+                <tr>
+                    <td class="td_info"></td>
+                    <td class="td_user_info user_info"><input type="text" name="enterprise_address" required="required" placeholder="企业通讯地址" value="{$userinfo['enterprise_address']}"></td>
+                </tr>
+                <tr>
+                    <td class="td_info">联系人姓名</td>
+                    <td class="td_user_info user_info"><input type="text" name="contact_name" required="required" placeholder="请输入联系人姓名" value="{$userinfo['contact_name']}"></td>
+                    <td class="td_user_info"></td>
+                </tr>
+                <tr>
+                    <td class="td_info">是否三证合一</td>
+                    <td class="td_user_info user_info address">
+                        <input style="margin-left: 0;" type="text" readonly="readonly" id="shi" value="是">
+                        <input type="text" readonly="readonly" id="fou" value="否">
+                        <input type="text"style="display: none;" id="whether" value="{$userinfo['whether']}">
+                    </td>
+                </tr>
+                <tr>
+                    <td class="td_info">社会信用代码</td>
+                    <td class="td_user_info user_info"><input type="text" name="credit_code" required="required" placeholder="请填写社会信用代码" value="{$userinfo['credit_code']}"></td>
+                </tr>
+                <tr class="picture">
+                    <td class="td_info"><div style="margin-top: -70px;">营业执照</div></td>
+                    <td class="td_user_info user_info images">
+                        <div class="images"><input type="file" name="images" /></div>
+                        <div style="width:180px;height: 20px;margin-top: 30px;margin-left:20px;text-align: center;font-size: 10px;color: #AAA;text-align: left;">
+                                <div>仅支持JPG.PNG格式,且小于2M</div>
+                                <div>请上传清晰,端正,文字内容可确认图片,否则可能审核失败</div>
+                        </div>
+                    </td>
+                </tr>
+                <tr>
+                    <td class="td_info">开户银行卡所在地</td>
+                    <td class="td_user_info user_info"><input type="text" name="bank_location" required="required" placeholder="请输入开户银行卡所在地" value="{$userinfo['bank_location']}"></td>
+                </tr>
+                <tr>
+                    <td class="td_info">开户银行</td>
+                    <td class="td_user_info user_info"><input type="text" name="bank" required="required" placeholder="请输入银行名称" value="{$userinfo['bank']}"></td>
+                </tr>
+                <tr>
+                    <td class="td_info"></td>
+                    <td class="td_user_info user_info"><input type="text" name="bankbranch" required="required" placeholder="请输入支行名称" value="{$userinfo['bankbranch']}"></td>
+                </tr>
+                <tr>
+                    <td class="td_info">开户银行账号</td>
+                    <td class="td_user_info user_info"><input type="text" name="debit_card" required="required" placeholder="请输入借记卡卡号" value="{$userinfo['userInfo_debit_card']}"></td>
+                </tr>
+                <tr>
+                    <td class="td_info"></td>
+                    <td class="td_user_info"><input type="checkbox" name="ch_box" id="ch_box" onclick="c_box()" /><span>同意 <a href="shenming.html" target="_blank"> 真实性声明</a></span></td>
+                </tr>
+                <tr>
+                    <td class="td_info"></td>
+                    <td class="td_user_info user_info">
+                        <input type="submit" value="确认" style="width: 70px;">&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="button" id="cancel" value="取消" style="width: 70px;">
+                    </td>
+                </tr>
+            </table>
+        </div>
+    </form>
+</div>
+<script>
+    //console.log(document.getElementById("gangaotai").value);
+    if(document.getElementById("hidden").value != ''){
+        if(document.getElementById("hidden").value == document.getElementById("china").value){
+            document.getElementById("china").style.borderColor = "dodgerblue";
+            document.getElementById("china").name = "area";
+        }
+        if(document.getElementById("hidden").value == document.getElementById("gangaotai").value){
+            document.getElementById("gangaotai").style.borderColor = "dodgerblue";
+            document.getElementById("gangaotai").name = "area";
+        }
+        if(document.getElementById("hidden").value == document.getElementById("overseas").value){
+            document.getElementById("overseas").style.borderColor = "dodgerblue";
+            document.getElementById("overseas").name = "area";
+        }
+    }
+    if(document.getElementById("whether").value != ''){
+        if(document.getElementById("whether").value == document.getElementById("shi").value){
+            document.getElementById("shi").style.borderColor = "dodgerblue";
+            document.getElementById("shi").name = "whether";
+        }
+        if(document.getElementById("whether").value == document.getElementById("fou").value){
+            document.getElementById("fou").style.borderColor = "dodgerblue";
+            document.getElementById("fou").name = "whether";
+        }
+    }
+    $("#cancel").click(function(){
+        window.history.back(-1);
+    });
+    $("#china").click(function(){
+        document.getElementById("china").style.borderColor = "dodgerblue";
+        document.getElementById("gangaotai").style.borderColor = "darkgrey";
+        document.getElementById("overseas").style.borderColor = "darkgrey";
+        document.getElementById("china").name = "area";
+        document.getElementById("gangaotai").name = "";
+        document.getElementById("overseas").name = "";
+    });
+    $("#gangaotai").click(function(){
+        document.getElementById("gangaotai").style.borderColor = "dodgerblue";
+        document.getElementById("china").style.borderColor = "darkgrey";
+        document.getElementById("overseas").style.borderColor = "darkgrey";
+        document.getElementById("gangaotai").name = "area";
+        document.getElementById("china").name = "";
+        document.getElementById("overseas").name = "";
+    });
+    $("#overseas").click(function(){
+        document.getElementById("overseas").style.borderColor = "dodgerblue";
+        document.getElementById("gangaotai").style.borderColor = "darkgrey";
+        document.getElementById("china").style.borderColor = "darkgrey";
+        document.getElementById("overseas").name = "area";
+        document.getElementById("gangaotai").name = "";
+        document.getElementById("china").name = "";
+    });
+    $("#shi").click(function(){
+        document.getElementById("shi").style.borderColor = "dodgerblue";
+        document.getElementById("fou").style.borderColor = "darkgrey";
+        document.getElementById("shi").name = "whether";
+        document.getElementById("fou").name = "";
+    });
+    $("#fou").click(function(){
+        document.getElementById("fou").style.borderColor = "dodgerblue";
+        document.getElementById("shi").style.borderColor = "darkgrey";
+        document.getElementById("fou").name = "whether";
+        document.getElementById("shi").name = "";
+    });
+
+</script>
+<script type="text/javascript">
+    layui.use('laydate', function(){
+        var laydate = layui.laydate;
+
+        //执行一个laydate实例
+        laydate.render({
+            elem: '#creatTime' //指定元素
+        });
+        laydate.render({
+            elem:'#timeRang',
+            range:true,
+            format: 'yyyy/MM/dd',
+            done: function(value, date){
+                /* 时间选择完成后的回调 */
+            }
+        })
+    });
+</script>
+{/block}

+ 1 - 1
application/user/view/certification/personal.html

@@ -10,7 +10,7 @@
         margin-top: 10px;
     }
     .td_info{
-        width: 120px;
+        width: 150px;
         height: 60px;
         line-height: 60px;
     }

BIN
public/static/user/images/certification/1.png


BIN
public/static/user/images/certification/1560404781_1.jpg


BIN
public/static/user/images/certification/2.png