|
|
|
@ -37,13 +37,14 @@ class OrdersController extends CommonController
|
|
|
|
$project = Project::find($project_id);
|
|
|
|
$project = Project::find($project_id);
|
|
|
|
$status = $request->get('status', 20);
|
|
|
|
$status = $request->get('status', 20);
|
|
|
|
|
|
|
|
|
|
|
|
$month = request()->month ?? date("Y-m");
|
|
|
|
$month = request()->month ?? '全部';
|
|
|
|
$months = (new StatisticsController())->_getMonths();
|
|
|
|
$months = (new OrdersController())->_getMonths();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if($month != '全部'){
|
|
|
|
$start_timestamp = strtotime($month);
|
|
|
|
$start_timestamp = strtotime($month);
|
|
|
|
$end_timestamp = strtotime("+1 month", strtotime($month));
|
|
|
|
$end_timestamp = strtotime("+1 month", strtotime($month));
|
|
|
|
|
|
|
|
|
|
|
|
$this->model = $this->model->whereRaw("UNIX_TIMESTAMP(`created_at`) >= " . $start_timestamp . " and UNIX_TIMESTAMP(`created_at`) < " . $end_timestamp);
|
|
|
|
$this->model = $this->model->whereRaw("UNIX_TIMESTAMP(`created_at`) >= " . $start_timestamp . " and UNIX_TIMESTAMP(`created_at`) < " . $end_timestamp);
|
|
|
|
|
|
|
|
}
|
|
|
|
$this->model = $this->model->where("project_id", $project_id);
|
|
|
|
$this->model = $this->model->where("project_id", $project_id);
|
|
|
|
|
|
|
|
|
|
|
|
if ($request->keyword) {
|
|
|
|
if ($request->keyword) {
|
|
|
|
@ -113,6 +114,26 @@ class OrdersController extends CommonController
|
|
|
|
return view($this->bladePath . ".index", compact("status", "data", "project_id", "month", "project", "hushizhang", "order_status_list"));
|
|
|
|
return view($this->bladePath . ".index", compact("status", "data", "project_id", "month", "project", "hushizhang", "order_status_list"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function _getMonths()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$months = [];
|
|
|
|
|
|
|
|
$months[] = '全部';
|
|
|
|
|
|
|
|
for ($i = 1; $i <= 12; $i++) {
|
|
|
|
|
|
|
|
$mm = $i < 10 ? "0" . $i : $i;
|
|
|
|
|
|
|
|
$months[] = (date("Y") - 2) . "-" . $mm;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for ($i = 1; $i <= 12; $i++) {
|
|
|
|
|
|
|
|
$mm = $i < 10 ? "0" . $i : $i;
|
|
|
|
|
|
|
|
$months[] = (date("Y") - 1) . "-" . $mm;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for ($i = 1; $i <= 12; $i++) {
|
|
|
|
|
|
|
|
$mm = $i < 10 ? "0" . $i : $i;
|
|
|
|
|
|
|
|
$months[] = date("Y") . "-" . $mm;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
view()->share(compact("months"));
|
|
|
|
|
|
|
|
return $months;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function changeItem(Request $request)
|
|
|
|
public function changeItem(Request $request)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$item = OrderItems::with(["order", "siblings"])->find($request->item_id);
|
|
|
|
$item = OrderItems::with(["order", "siblings"])->find($request->item_id);
|
|
|
|
|