You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
15 KiB

2 years ago
<?php /** * [Laike System] Copyright (c) 2017-2020 laiketui.com * Laike is not a free software, it under the license terms, visited http://www.laiketui.com/ for more details. */ require_once(MO_LIB_DIR . '/DBAction.class.php'); require_once(MO_LIB_DIR . '/ShowPager.class.php'); require_once(MO_LIB_DIR . '/Tools.class.php'); require_once(MO_LIB_DIR . '/version.php'); class IndexAction extends Action { public function getDefaultView() { $db = DBAction::getInstance(); $request = $this->getContext()->getRequest(); $admin_id = $this->getContext()->getStorage()->read('admin_id'); $version = LKT_VERSION; $authorization = ''; if (isset($_SESSION['LAI_KE'])) { $authorization = $_SESSION['LAI_KE']; } $sql = " select login_num,login_ip,login_time from ntb_admin where admin_id = '$admin_id' limit 1 "; $r = $db->select($sql); //状态查询 $mon = date("Y-m");//当前月份 //得到系统的年月 $tmp_date = date("Ym"); //切割出年份 $tmp_year = substr($tmp_date, 0, 4); //切割出月份 $tmp_mon = substr($tmp_date, 4, 2); $tmp_forwardmonth = mktime(0, 0, 0, $tmp_mon - 1, 1, $tmp_year); //得到当前月的上一个月 $lastmon = date("Y-m", $tmp_forwardmonth); //今天 $today = date("Y-m-d"); //昨天 $yesterday = date("Y-m-d", strtotime("-1 day")); //qiantian $qiantian = date("Y-m-d", strtotime("-2 day")); $sitian = date("Y-m-d", strtotime("-3 day")); $wutian = date("Y-m-d", strtotime("-4 day")); //liutian $liutian = date("Y-m-d", strtotime("-5 day")); //qitian $qitian = date("Y-m-d", strtotime("-6 day")); $today1 = date("m-d"); //昨天 $yesterday1 = date("m-d", strtotime("-1 day")); //qiantian $qiantian1 = date("m-d", strtotime("-2 day")); $sitian1 = date("m-d", strtotime("-3 day")); $wutian1 = date("m-d", strtotime("-4 day")); //liutian $liutian1 = date("m-d", strtotime("-5 day")); //qitian $qitian1 = date("m-d", strtotime("-6 day")); //--待付款 $dfk_sql = "select num from lkt_order where status = 0"; $dfk = $db->selectrow($dfk_sql); //--待发货 $dfh_sql = "select num from lkt_order where status = 1"; $dp = $db->selectrow($dfh_sql); //--待收货 $dsh_sql = "select num from lkt_order where status = 2"; $yth = $db->selectrow($dsh_sql); //待评价订单 $pj_sql = "select num from lkt_order where status = 3"; $pj = $db->selectrow($pj_sql); //退货订单 $th_sql = "select num from lkt_order_details where r_status = 4"; $th = $db->selectrow($th_sql); //已完成订单 $wc_sql = "select num from lkt_order where status = 5"; $wc = $db->selectrow($wc_sql); //当日的营业额 $day_sql = "select sum(z_price) as z_price from lkt_order where add_time like '$today%' and status > 0 and status <> 4 ";//除退款的总金额,包含运费 $day01 = $db->select($day_sql); $day_yy01 = $day01[0]->z_price; $day_yy = $day_yy01 ? $day_yy01 : 0; $day001 = $db->select("select sum(re_money) as re_money from lkt_order_details where add_time like '$today%' and r_status = 6 and re_type > 0 "); $day_yy001 = $day001[0]->re_money; $day_yy001 = $day_yy001 ? $day_yy001 : 0; $day_yy = $day_yy - $day_yy001; //昨天的营业额 $yessql = "select sum(z_price) as z_price from lkt_order where add_time like '$yesterday%' and status > 0 and status <> 4 "; $yes01 = $db->select($yessql); $yes_yyy = $yes01[0]->z_price; $yes_yy = $yes_yyy ? $yes_yyy : 0; $yes_yyy001 = $db->select("select sum(re_money) as re_money from lkt_order_details where add_time like '$yesterday%' and r_status = 6 and re_type > 0 "); $yes_