linwu 6 ماه پیش
والد
کامیت
317ba52ca9

+ 19 - 12
app/admin/controller/Human.php

@@ -7,6 +7,7 @@ use app\common\model\HumanEnterpriseApplyModel;
 use app\common\model\HumanEnterpriseModel;
 use app\common\model\HumanInstitutionApplyModel;
 use app\common\model\HumanInstitutionModel;
+use app\common\service\QrcodeService;
 use app\common\validate\HumanEnterpriseValidate;
 use app\common\validate\HumanInstitutionValidate;
 use think\exception\ValidateException;
@@ -19,19 +20,22 @@ class Human extends AdminBaseController
      */
     public function institutionApply()
     {
+        $file_url = QrcodeService::getQrcode('human_arrive', url('/mobile/human/arrive'), 600);
         return view('', [
-            'status_list' => HumanInstitutionApplyModel::STATUS,
+            'status_list'    => HumanInstitutionApplyModel::STATUS,
+            'is_arrive_list' => HumanInstitutionApplyModel::IS_ARRIVE,
+            'file_url'       => $file_url,
         ]);
     }
 
     public function listInstitutionApply()
     {
-        $map   = $this->dealEqualInput(['status'], $this->dealLikeInput(['name']));
+        $map   = $this->dealEqualInput(['status', 'is_arrive'], $this->dealLikeInput(['name']));
         $list  = HumanInstitutionApplyModel::where($map)
             ->order(['status' => 'asc'])
             ->limit(input('limit'))
             ->page(input('page'))
-            ->append(['status_text'])
+            ->append(['status_text', 'is_arrive_text'])
             ->select();
         $count = HumanInstitutionApplyModel::where($map)->count();
         if ($count == 0) {
@@ -50,11 +54,11 @@ class Human extends AdminBaseController
 
     public function institutionDetail()
     {
-        $id = input('id/d');
-        $info      = HumanInstitutionApplyModel::find($id);
+        $id   = input('id/d');
+        $info = HumanInstitutionApplyModel::find($id);
 
         return view('', [
-            'info'        => $info,
+            'info' => $info,
         ]);
     }
 
@@ -63,19 +67,22 @@ class Human extends AdminBaseController
      */
     public function enterpriseApply()
     {
+        $file_url = QrcodeService::getQrcode('human_arrive', url('/mobile/human/arrive'), 600);
         return view('', [
-            'status_list' => HumanEnterpriseApplyModel::STATUS,
+            'status_list'    => HumanEnterpriseApplyModel::STATUS,
+            'is_arrive_list' => HumanEnterpriseApplyModel::IS_ARRIVE,
+            'file_url'       => $file_url,
         ]);
     }
 
     public function listEnterpriseApply()
     {
-        $map   = $this->dealEqualInput(['status'], $this->dealLikeInput(['name']));
+        $map   = $this->dealEqualInput(['status', 'is_arrive'], $this->dealLikeInput(['name']));
         $list  = HumanEnterpriseApplyModel::where($map)
             ->order(['status' => 'asc'])
             ->limit(input('limit'))
             ->page(input('page'))
-            ->append(['status_text'])
+            ->append(['status_text', 'is_arrive_text'])
             ->select();
         $count = HumanEnterpriseApplyModel::where($map)->count();
         if ($count == 0) {
@@ -94,11 +101,11 @@ class Human extends AdminBaseController
 
     public function enterpriseDetail()
     {
-        $id = input('id/d');
-        $info      = HumanEnterpriseApplyModel::find($id);
+        $id   = input('id/d');
+        $info = HumanEnterpriseApplyModel::find($id);
 
         return view('', [
-            'info'        => $info,
+            'info' => $info,
         ]);
     }
 

+ 31 - 0
app/admin/view/human/enterprise_apply.html

@@ -19,6 +19,17 @@
                         </select>
                     </div>
                 </div>
+                <div class="layui-inline">
+                    <label class="layui-form-label">签到</label>
+                    <div class="layui-input-block">
+                        <select name="is_arrive">
+                            <option value="">全部状态</option>
+                            {volist name="is_arrive_list" id="v"}
+                            <option value="{$key}">{$v}</option>
+                            {/volist}
+                        </select>
+                    </div>
+                </div>
                 <div class="layui-inline">
                     <button class="layui-btn" lay-submit lay-filter="{$lay_btn}">
                         <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
@@ -27,6 +38,7 @@
             </div>
         </div>
         <div class="layui-form layui-card-header layuiadmin-card-header-auto">
+            <button class="layui-btn layuiadmin-btn layui-btn-normal" data-type="qrcode">签到码</button>
             <button class="layui-btn layuiadmin-btn layui-btn-normal" data-type="pass">审核通过</button>
             <button class="layui-btn layuiadmin-btn layui-btn-danger" data-type="disabled">审核不通过</button>
         </div>
@@ -69,6 +81,7 @@
                     {field: 'cooperate', title: '希望合作的业务', width: 200},
                     {field: 'suggestion', title: '对本次活动想说的话'},
                     {field: 'status_text', title: '状态', width: 100, align: 'center'},
+                    {field: 'is_arrive_text', title: '签到', width: 100, align: 'center'},
                     {field: 'create_time', title: '申请时间', width: 160, align: 'center'},
                     {title: '操作', width: 300, align: 'center', fixed: 'right', toolbar: '#setTpl'}
                 ]
@@ -90,6 +103,24 @@
 
         //事件
         const active = {
+            qrcode: function () {
+                layer.photos({
+                    photos: {
+                        "title": "", //相册标题
+                        "id": 123, //相册id
+                        "start": 0, //初始显示的图片序号,默认0
+                        "data": [   //相册包含的图片,数组格式
+                            {
+                                "alt": "图片名",
+                                "pid": 666, //图片id
+                                "src": "{$file_url}", //原图地址
+                                "thumb": "" //缩略图地址
+                            }
+                        ]
+                    }
+                    ,anim: 5 //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数)
+                });
+            },
             pass: function () {
                 const check_data = table.checkStatus('{$lay_table}').data; //得到选中的数据
                 if (check_data.length === 0) {

+ 31 - 0
app/admin/view/human/institution_apply.html

@@ -19,6 +19,17 @@
                         </select>
                     </div>
                 </div>
+                <div class="layui-inline">
+                    <label class="layui-form-label">签到</label>
+                    <div class="layui-input-block">
+                        <select name="is_arrive">
+                            <option value="">全部状态</option>
+                            {volist name="is_arrive_list" id="v"}
+                            <option value="{$key}">{$v}</option>
+                            {/volist}
+                        </select>
+                    </div>
+                </div>
                 <div class="layui-inline">
                     <button class="layui-btn" lay-submit lay-filter="{$lay_btn}">
                         <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
@@ -27,6 +38,7 @@
             </div>
         </div>
         <div class="layui-form layui-card-header layuiadmin-card-header-auto">
+            <button class="layui-btn layuiadmin-btn layui-btn-normal" data-type="qrcode">签到码</button>
             <button class="layui-btn layuiadmin-btn layui-btn-normal" data-type="pass">审核通过</button>
             <button class="layui-btn layuiadmin-btn layui-btn-danger" data-type="disabled">审核不通过</button>
         </div>
@@ -68,6 +80,7 @@
                     {field: 'wechat', title: '微信号', width: 160},
                     {field: 'suggestion', title: '对本次活动想说的话'},
                     {field: 'status_text', title: '状态', width: 100, align: 'center'},
+                    {field: 'is_arrive_text', title: '签到', width: 100, align: 'center'},
                     {field: 'create_time', title: '申请时间', width: 160, align: 'center'},
                     {title: '操作', width: 300, align: 'center', fixed: 'right', toolbar: '#setTpl'}
                 ]
@@ -89,6 +102,24 @@
 
         //事件
         const active = {
+            qrcode: function () {
+                layer.photos({
+                    photos: {
+                        "title": "", //相册标题
+                        "id": 123, //相册id
+                        "start": 0, //初始显示的图片序号,默认0
+                        "data": [   //相册包含的图片,数组格式
+                            {
+                                "alt": "图片名",
+                                "pid": 666, //图片id
+                                "src": "{$file_url}", //原图地址
+                                "thumb": "" //缩略图地址
+                            }
+                        ]
+                    }
+                    ,anim: 5 //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数)
+                });
+            },
             pass: function () {
                 const check_data = table.checkStatus('{$lay_table}').data; //得到选中的数据
                 if (check_data.length === 0) {

+ 8 - 1
app/common/model/HumanEnterpriseApplyModel.php

@@ -12,19 +12,26 @@ class HumanEnterpriseApplyModel extends BaseModel
 
     protected $type = [
         'cooperate' => 'array',
-        'images' => 'array',
+        'images'    => 'array',
     ];
 
     // 常量
     const STATUS = [1 => '待审核', 2 => '审核通过', 3 => '审核不通过'];
+    const IS_ARRIVE = [1 => '已签到', 2 => '未签到'];
 
     const STATUS_WAIT = 1;
     const STATUS_PASS = 2;
     const STATUS_DISABLED = 3;
+    const IS_ARRIVE_YES = 1;
+    const IS_ARRIVE_NO = 1;
 
     public function getStatusTextAttr($value, $data)
     {
         return self::STATUS[$data['status']];
     }
 
+    public function getIsArriveTextAttr($value, $data)
+    {
+        return self::IS_ARRIVE[$data['is_arrive']];
+    }
 }

+ 8 - 0
app/common/model/HumanInstitutionApplyModel.php

@@ -16,14 +16,22 @@ class HumanInstitutionApplyModel extends BaseModel
 
     // 常量
     const STATUS = [1 => '待审核', 2 => '审核通过', 3 => '审核不通过'];
+    const IS_ARRIVE = [1 => '已签到', 2 => '未签到'];
 
     const STATUS_WAIT = 1;
     const STATUS_PASS = 2;
     const STATUS_DISABLED = 3;
+    const IS_ARRIVE_YES = 1;
+    const IS_ARRIVE_NO = 1;
 
     public function getStatusTextAttr($value, $data)
     {
         return self::STATUS[$data['status']];
     }
 
+    public function getIsArriveTextAttr($value, $data)
+    {
+        return self::IS_ARRIVE[$data['is_arrive']];
+    }
+
 }

+ 28 - 0
app/mobile/controller/Human.php

@@ -17,6 +17,7 @@ class Human extends MobileBaseController
     {
         $open_id = session('mobile.human.open_id');
         if (empty($open_id)) {
+            session('mobile.human.back_url', request()->url(true));
             $response = redirect('https://www.jucai.gov.cn/api/auth/wechat_auth?url=' . urlencode(url('/mobile/login/humanLogin')));
             throw new \think\exception\HttpResponseException($response);
         }
@@ -208,6 +209,33 @@ class Human extends MobileBaseController
         return view();
     }
 
+    public function arrive()
+    {
+        $open_id = session('mobile.human.open_id');
+
+        $institution = HumanInstitutionApplyModel::where('open_id', $open_id)->find();
+        $enterprise  = HumanEnterpriseApplyModel::where('open_id', $open_id)->find();
+
+        $msg = '';
+        if (empty($institution) && empty($enterprise)) {
+            $msg = '请先报名';
+        }
+
+        if (!empty($institution)) {
+            $institution->is_arrive = HumanInstitutionApplyModel::IS_ARRIVE_YES;
+            $institution->save();
+            $msg = '签到成功';
+        }
+
+        if (!empty($enterprise)) {
+            $enterprise->is_arrive = HumanEnterpriseApplyModel::IS_ARRIVE_YES;
+            $enterprise->save();
+            $msg = '签到成功';
+        }
+
+        return view('',['msg' => $msg]);
+    }
+
     private function _formValidate()
     {
         $open_id = session('mobile.human.open_id');

+ 8 - 3
app/mobile/controller/Login.php

@@ -2,7 +2,6 @@
 
 namespace app\mobile\controller;
 
-use app\common\model\HumanEnterpriseApplyModel;
 use app\common\model\UserModel;
 use app\mobile\MobileBaseController;
 
@@ -68,9 +67,15 @@ class Login extends MobileBaseController
 
     public function humanLogin()
     {
-        $param   = input('param.');
+        $param = input('param.');
+
+        session('mobile.human.open_id', $param['openid']);
+        $back_url = session('mobile.human.back_url');
 
-        session('mobile.human.open_id',$param['openid']);
+        if (!empty($back_url)) {
+            session('mobile.human.back_url', null);
+            return redirect($back_url);
+        }
 
         return redirect(url('human/index'));
     }

+ 67 - 0
app/mobile/view/human/arrive.html

@@ -0,0 +1,67 @@
+{extend name="public/base_human"/}
+{block name="css"}
+<style>
+    .icon{
+        text-align:center;
+        margin-top:50px;
+    }
+
+    .msg{
+        text-align:center;
+        margin:0;
+        padding:0;
+        font-size:24px;
+    }
+    .click {
+        text-align:center;
+        margin-top:10px;
+        font-size:14px;
+        color:var(--blue);
+    }
+    .tips{
+        text-align:center;
+        margin-top:50px;
+        font-size:14px;
+        color:#aaa;
+    }
+
+    .tips .num{
+        color:#FF589B;
+    }
+
+    .wechat {
+        width: 80%;
+        display: block;
+        margin: 0 auto;
+    }
+</style>
+{/block}
+{block name="body"}
+<van-nav-bar
+        class="nav-theme"
+        :fixed="true"
+        :placeholder="true"
+>
+    <template #title>
+        <span class="text-white">提示</span>
+    </template>
+</van-nav-bar>
+<div style="width:100%;height:46px;"></div>
+<h3 class="msg">{$msg}</h3>
+<p class="click" @click="toUrl">点我进入下一步</p>
+<p class="tips">如有疑问,请加下方工作人员微信</p>
+<img src="/static/mobile/images/wechat_qrcode.png" class="wechat" alt="">
+{/block}
+{block name="script"}
+<script>
+    function v_setup() {
+        let base = {};
+
+        base.toUrl = () => {
+            location.href = "{:url('human/index')}";
+        };
+
+        return base;
+    }
+</script>
+{/block}

+ 57 - 0
app/mobile/view/humanarrive/index.html

@@ -0,0 +1,57 @@
+{extend name="public/base_human"/}
+{block name="css"}
+<style>
+    .icon{
+        text-align:center;
+        margin-top:50px;
+    }
+
+    .msg{
+        text-align:center;
+        margin:0;
+        padding:0;
+        font-size:24px;
+    }
+
+    .tips{
+        text-align:center;
+        margin-top:50px;
+        font-size:14px;
+        color:#aaa;
+    }
+
+    .tips .num{
+        color:#FF589B;
+    }
+
+    .wechat {
+        width: 80%;
+        display: block;
+        margin: 0 auto;
+    }
+</style>
+{/block}
+{block name="body"}
+<van-nav-bar
+        class="nav-theme"
+        :fixed="true"
+        :placeholder="true"
+>
+    <template #title>
+        <span class="text-white">提示</span>
+    </template>
+</van-nav-bar>
+<div style="width:100%;height:46px;"></div>
+<h3 class="msg">{$msg}</h3>
+<p class="tips">如有疑问,请加下方工作人员微信</p>
+<img src="/static/mobile/images/wechat_qrcode.png" class="wechat" alt="">
+{/block}
+{block name="script"}
+<script>
+    function v_setup() {
+        let base = {};
+
+        return base;
+    }
+</script>
+{/block}