|
@@ -96,10 +96,10 @@ class Index
|
|
|
])->field("sent_review_amount,sent_review_cost,review_add_reduce_rate,authorize_amount,engineering_type1")->select();
|
|
|
} else if ($this->user_tpe == 1) {
|
|
|
$sent_review_amount = Db::name("cost_project")->where([
|
|
|
- ["sent_review_unit", "=", $this->unit],
|
|
|
+ ["sent_review_unit", "=", get_login_admin("unit_name")],
|
|
|
['delete_time', '=', 0],
|
|
|
- ["project_status", ">", 2]
|
|
|
-
|
|
|
+ ["project_status", ">", 2],
|
|
|
+ ["project_status", "<>", 9],
|
|
|
])->field("sent_review_amount,sent_review_cost,review_add_reduce_rate,authorize_amount,engineering_type1")->select();
|
|
|
}
|
|
|
|
|
@@ -279,6 +279,7 @@ class Index
|
|
|
$second_sent_review_cost = [];
|
|
|
}
|
|
|
} else if ($this->user_tpe == 1) {
|
|
|
+
|
|
|
$first_sent_review_cost = Db::name("cost_project")->where([
|
|
|
['project_status', '>', 2], ["sent_review_unit", "=", $this->unit]
|
|
|
])->
|
|
@@ -297,6 +298,7 @@ class Index
|
|
|
} else {
|
|
|
$second_sent_review_cost = [];
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
$sent_review_cost = [
|
|
@@ -335,17 +337,29 @@ class Index
|
|
|
['delete_time', '=', 0],
|
|
|
["project_status", '>', 2],
|
|
|
|
|
|
- ];
|
|
|
- } else if ($this->user_tpe == 1) {
|
|
|
- $where = [
|
|
|
- ["sent_review_unit", "=", $this->unit],
|
|
|
- ['delete_time', '=', 0],
|
|
|
- ["project_status", '>', 2],
|
|
|
-
|
|
|
];
|
|
|
}
|
|
|
-
|
|
|
- $data = Db::name("cost_project")->where($where)->select();
|
|
|
+ if($this->user_tpe == 1){
|
|
|
+ $data = Db::name("cost_project")
|
|
|
+ ->where(function($query) {
|
|
|
+ $query->where([
|
|
|
+ ["sent_review_unit", "=", get_login_admin("unit_name")],
|
|
|
+ ['delete_time', '=', 0],
|
|
|
+ ["proprietor_status", '>', 1],
|
|
|
+ ["project_status", '=', 0],
|
|
|
+ ]);
|
|
|
+ })
|
|
|
+ ->whereOr(function($query) {
|
|
|
+ $query->where([
|
|
|
+ ["sent_review_unit", "=", get_login_admin("unit_name")],
|
|
|
+ ['delete_time', '=', 0],
|
|
|
+ ["project_status", '>', 0],
|
|
|
+ ]);
|
|
|
+ })
|
|
|
+ ->select();
|
|
|
+ }else{
|
|
|
+ $data = Db::name("cost_project")->where($where)->select();
|
|
|
+ }
|
|
|
// halt($data);
|
|
|
$num_project = [
|
|
|
'num' => 0,
|
|
@@ -419,6 +433,8 @@ class Index
|
|
|
}
|
|
|
|
|
|
$unit_type = Db::name("department")->where("id", get_login_admin("unit_name"))->value("type");
|
|
|
+
|
|
|
+
|
|
|
View::assign('unit_type', $unit_type);
|
|
|
View::assign("red_kan", $red_kan);
|
|
|
View::assign("sent_review_cost", $sent_review_cost_real);
|