Procházet zdrojové kódy

Merge remote-tracking branch 'origin/dev' into dev

yzx před 5 měsíci
rodič
revize
571341cc67

+ 4 - 0
app/admin/controller/project/Cost.php

@@ -1557,6 +1557,10 @@ class Cost extends BaseController
         return view();
     }
 
+    public function concern_datalist()
+    {
+        return view();
+    }
 
 }
 

+ 5 - 0
app/admin/controller/project/CostCompany.php

@@ -1662,6 +1662,11 @@ class CostCompany extends BaseController
         View::assign('detailId', $id);
         return view();
     }
+
+    public function concern_datalist()
+    {
+        return view();
+    }
   
 }
 

+ 238 - 0
app/mobile/controller/Temporary.php

@@ -1122,6 +1122,244 @@ class Temporary extends BaseController
     {
         return view();
     }
+
+    public function kan_list()
+    {
+        //根据所登录的账号,查询跟本身有关的项目
+        //2是公司,0是财政局,1是业主
+        $param = get_params();
+
+        $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit'];
+        $order = empty($param['order']) ? 'id desc' : $param['order'];
+        if (isset($param["project_start_time"])) {
+            $param["project_start_time"] = $param["project_start_time"] ? strtotime($param["project_start_time"]) : 0;
+        }
+        if (isset($param["project_end_time"])) {
+            $param["project_end_time"] = $param["project_end_time"] ? strtotime($param["project_end_time"]) : 0;
+        }
+        $where3 = [];//搜索条件
+        if (!empty($param['project_status'])) {
+            $where3[] = ['project_status', '=', $param['project_status']];
+        }
+        if (!empty($param['province'])) {
+            $where3[] = ['province', '=', $param['province']];
+        }
+        if (!empty($param['city'])) {
+            $where3[] = ['city', '=', $param['city']];
+        }
+        if (!empty($param['area'])) {
+            $where3[] = ['area', '=', $param['area']];
+        }
+        if (!empty($param['project_end_time'])) {
+            $where3[] = ['project_end_time', '<', $param['project_end_time']];
+        }
+        if (!empty($param['project_start_time'])) {
+            $where3[] = ['project_start_time', '>', $param['project_start_time']];
+        }
+        if (!empty($param['keyword'])) {
+            $keyword = $param['keyword'];
+            $where3[] = ['project_num|project_name|review_unit', 'like', '%' . $keyword . '%'];
+        }
+        if (!empty($param['review_unit_name'])) {
+            $where3[] = ['review_unit_name', 'like', '%' . $param['review_unit_name'] . '%'];
+        }
+        if (!empty($param['sent_review_unit_name'])) {
+            $where3[] = ['sent_review_unit_name', 'like', '%' . $param['sent_review_unit_name'] . '%'];
+        }
+        if (!empty($param['entrust_unit_name'])) {
+            $where3[] = ['entrust_unit_name', 'like', '%' . $param['entrust_unit_name'] . '%'];
+        }
+
+        $unit_type = Db::name("department")->where("id", get_login_admin("unit_name"))->value("type");
+        $inarr = array();
+
+        if ($unit_type == 0) {
+            $where[] = ["delete_time", "=", 0];
+            $where[] = ["project_status", ">", 0];
+            $where[] = ["entrust_unit", "=", get_login_admin('unit_name')];
+            $where2[] = ["delete_time", "=", 0];
+            $where2[] = ["project_status", ">", 0];
+            $where2[] = ["entrust_unit", "=", get_login_admin('unit_name')];
+            //项目可见的权限
+            $field = $this->Field->get_field_rules_new($this->uid);
+            //1全部-可查看可编辑,2全部-可查看,0与我有关
+            $see_auth = isset($field["see_auth"]) ? $field["see_auth"] : 3;
+            if ($see_auth == 3) {
+                $where[] = ["entrust_maker", "=", $this->uid];
+
+                $where2[] = ["entrust_approver", "=", $this->uid];
+                $where2[] = ["project_status", ">", 1];
+
+            } elseif ($see_auth == 0) {
+                $where[] = ["entrust_maker", "=", $this->uid];
+                $where[] = ["project_status", ">", 0];
+                $where2[] = ["entrust_approver", "=", $this->uid];
+                $where2[] = ["project_status", ">", 1];
+            }
+            $list = $this->model->where($where3)
+                ->where(function ($query) use ($where,$where2) {
+                    // 第一组条件(entrust_maker)
+                    $query->where(function ($q1) use ($where) {
+                        $q1->where($where);
+                    });
+                    // 使用 OR 连接第二组条件(entrust_approver)
+                    $query->whereOr(function ($q2) use ($where2) {
+                        $q2->where($where2);
+                    });
+                })
+                ->order("create_time desc")->paginate(9999, false, ['query' => $param])
+                ->each(function ($item) {
+                    $red = Db::name("new_msg")->where([["project_id", "=", $item->id], ["uid", "=", $this->uid]])->find();
+                    if ($red) {
+                        if ($red["detail"] || $red["comment"] || $red["report"] || $red["user"] || $red["contact"]) {
+                            $item->red = 1;
+                        } else {
+
+                            $item->red = 0;
+                        }
+                    } else {
+                        $item->red = 0;
+                    }
+                    if (($item->province && $item->city && $item->area)) {
+                        $item->project_region = $item->province . '-' . $item->city . '-' . $item->area;
+                    }
+
+                })->toArray();
+        } elseif ($unit_type == 2) {
+            $order = empty($param['order']) ? 'project_receive_time desc,id desc' : $param['order'];
+
+            $where = [
+                ["delete_time", "=", 0],
+                ["project_status", ">", 3],
+                ["review_unit", "=", get_login_admin("unit_name")]
+            ];
+            $review_unit = $this->model->where($where)->where($where3)->field('id,review_head,operate_head,operate_team')->select()->toArray();
+            for ($i = 0; $i < count($review_unit); $i++) {
+                $a = $review_unit[$i];
+                $ids = $a["review_head"] . ',' . $a["operate_head"] . ',' . $a["operate_team"];
+                $ids = explode(",", $ids);
+                $c = in_array($this->uid, $ids);
+                if ($c) {
+                    $inarr[] = $a["id"];
+                }
+            }
+
+
+            $field = $this->Field->get_field_rules_New($this->uid);
+            $see_auth = isset($field["see_auth"]) ? $field["see_auth"] : 3;
+            $this->see_auth = $see_auth;
+            if ($see_auth == 3) {
+
+                $list = $this->model
+                    ->where($where)->where($where3)->whereIn("id", $inarr)
+                    ->order($order)->paginate(9999, false, ['query' => $param])
+                    ->each(function ($item) {
+
+                        $red = Db::name("new_msg")->where([["project_id", "=", $item->id], ["uid", "=", $this->uid]])->find();
+                        if ($red) {
+
+                            if ($red["detail"] || $red["comment"] || $red["report"] || $red["record"] || $red["user"] || $red["contact"]) {
+                                $item->red = 1;
+                            } else {
+                                $item->red = 0;
+                            }
+                        } else {
+                            $item->red = 0;
+                        }
+
+                    })->toArray();
+
+            } elseif ($see_auth == 0) {
+                $list = $this->model
+                    ->where($where)->where($where3)->whereIn("id", $inarr)
+                    ->order($order)->paginate(9999, false, ['query' => $param])
+                    ->each(function ($item) {
+
+                        $red = Db::name("new_msg")->where([["project_id", "=", $item->id], ["uid", "=", $this->uid]])->find();
+                        if ($red) {
+                            if ($red["detail"] || $red["comment"] || $red["report"] || $red["record"] || $red["user"] || $red["contact"]) {
+                                $item->red = 1;
+                            } else {
+                                $item->red = 0;
+                            }
+                        } else {
+                            $item->red = 0;
+                        }
+
+                    })->toArray();
+            } else {
+                $list = $this->model
+                    ->where($where)
+                    ->order($order)->where($where3)->paginate(9999, false, ['query' => $param])
+                    ->each(function ($item) {
+
+                        $red = Db::name("new_msg")->where([["project_id", "=", $item->id], ["uid", "=", $this->uid]])->find();
+                        if ($red) {
+                            if ($red["detail"] || $red["comment"] || $red["report"] || $red["record"] || $red["user"] || $red["contact"]) {
+                                $item->red = 1;
+                            } else {
+                                $item->red = 0;
+                            }
+                        } else {
+                            $item->red = 0;
+                        }
+                    })->toArray();
+            }
+
+        } elseif ($unit_type == 1) {
+            $field = $this->Field->get_field_rules_New($this->uid);
+            $see_auth = isset($field["see_auth"]) ? $field["see_auth"] : 3;
+            if ($see_auth == 0 || $see_auth == 3) {
+                $where = [
+                    ["delete_time", "=", 0],
+                    ["sent_review_unit", "=", get_login_admin("unit_name")],
+                    ["sent_review_head", "=", $this->uid]
+                ];
+            } else {
+                $where = [
+                    ["delete_time", "=", 0],
+                    ["sent_review_unit", "=", get_login_admin("unit_name")]
+                ];
+            }
+            $list = $this->model
+                ->where($where)
+                ->order($order)->where($where3)->paginate(9999, false, ['query' => $param])
+                ->each(function ($item) {
+
+                    $red = Db::name("new_msg")->where([["project_id", "=", $item->id], ["uid", "=", $this->uid]])->find();
+                    if ($red) {
+                        if ($red["detail"] || $red["comment"] || $red["report"] || $red["record"] || $red["user"] || $red["contact"]) {
+                            $item->red = 1;
+                        } else {
+                            $item->red = 0;
+                        }
+                    } else {
+                        $item->red = 0;
+                    }
+                })->toArray();
+        } else {
+            $list["data"] = [];
+        }
+
+
+        $data = $list["data"];
+        $real_list = array_values(array_column($data, NULL, 'id'));
+
+        $red = $this->Auditmodel->where("approver", $this->uid)->where("audit_status", 1)->count();
+        $red_id = Db::name("new_msg")->where("uid", "=", $this->uid)->select();
+        $red_kan = 0;
+        foreach ($red_id as $item => $value) {
+            if ($value["detail"] || $value["comment"] || $value["report"] || $value["user"] || $value["contact"]) {
+                $red_kan = 1;
+            }
+        }
+        View::assign("red_kan", $red_kan);
+        View::assign("detail", $real_list);
+        View::assign("red", $red);
+        View::assign("unit_type", $unit_type);
+        return view();
+    }
+
 }
 
 

+ 22 - 1
app/mobile/view/temporary/detail.html

@@ -15,8 +15,29 @@
 </head>
 
 <body>
+<div class="top">
+    <a href="{:url('mobile/temporary/kan_list')}">
+        <div><img src="{__MOBILE__}/img/left.png" alt="" style="width: 5vw;"></div>
+    </a>
+    <div style="margin-left: 36vw;">看板</div>
 
-<div class="layui-tab layui-tab-brief" style="margin: 0 !important;"  lay-filter="test-hash">
+
+    <div class="dropdown">
+        <!-- <button onclick="dropdown()" class="dropbtn" style="margin-left: 28vw;background: url({__MOBILE__}/img/list.png) no-repeat;width: 5vw;"> -->
+        <button onclick="dropdown()" class="dropbtn" style="margin-left: 33vw;">
+
+
+            <img src="{__MOBILE__}/img/list.png" alt="" style="width: 5vw;pointer-events: none;">
+        </button>
+        <div id="myDropdown" class="dropdown-content" style="width: 24vw;">
+            <a href="{:url('mobile/index/main')}">首页</a>
+            <a href="{:url('mobile/index/kan_list')}">看板</a>
+            <a href="{:url('mobile/index/pending')}">待处理</a>
+            <a href="{:url('mobile/index/person')}">我的</a>
+        </div>
+    </div>
+</div>
+<div class="layui-tab layui-tab-brief" style="margin-top: 11.5vw;"  lay-filter="test-hash">
 
     <ul class="layui-tab-title" style="background-color: #fff;" id="ullist">