|
@@ -7,7 +7,7 @@ use app\admin\model\store\StoreProduct;
|
|
|
use app\common\controller\Backend;
|
|
|
use think\Config;
|
|
|
use app\admin\model\Member;
|
|
|
-
|
|
|
+use app\admin\model\ShopUser;
|
|
|
/**
|
|
|
* 控制台
|
|
|
*
|
|
@@ -22,6 +22,16 @@ class Dashboard extends Backend
|
|
|
*/
|
|
|
public function index()
|
|
|
{
|
|
|
+
|
|
|
+// $effect_city=$this->auth->effect_city;
|
|
|
+// $get_suser_id=[];
|
|
|
+// if (!empty($effect_city)){
|
|
|
+//
|
|
|
+// $where_suser['effect_city']=['like','%'.$effect_city.'%'];
|
|
|
+// $get_suser_list=ShopUser::where($where_suser)->field('id')->select();
|
|
|
+// $get_suser_id=array_column($get_suser_list,'id');
|
|
|
+//
|
|
|
+// }
|
|
|
$seventtime = \fast\Date::unixtime('day', -7);
|
|
|
$paylist = $createlist = [];
|
|
|
for ($i = 0; $i <= 7; $i++)
|
|
@@ -32,10 +42,15 @@ class Dashboard extends Backend
|
|
|
|
|
|
|
|
|
$where1['status']=array('in',['1','2','3','0','9']);
|
|
|
- $get_num_xiadan=StoreOrder::where($where1)->field('count(*) as num')->find();
|
|
|
+ if (count($this->auth->suser_id)>0){
|
|
|
+ $where1['suser_id']=['in',$this->auth->suser_id];
|
|
|
+ }
|
|
|
|
|
|
+ $get_num_xiadan=StoreOrder::where($where1)->field('count(*) as num')->find();
|
|
|
+ //dump($get_num_xiadan);exit;
|
|
|
|
|
|
$where1['status']=array('in',['1','2','3']);
|
|
|
+
|
|
|
$get_num_wancheng=StoreOrder::where($where1)->field('count(*) as num')->find();
|
|
|
|
|
|
|
|
@@ -53,6 +68,10 @@ class Dashboard extends Backend
|
|
|
$get_member_count=Member::field('count(*) as num')->find();
|
|
|
|
|
|
$order_where['status']=array('in',['3','4']);
|
|
|
+
|
|
|
+ if (count($this->auth->suser_id)>0){
|
|
|
+ $order_where['suser_id']=['in',$this->auth->suser_id];
|
|
|
+ }
|
|
|
$get_order_count=StoreOrder::where($order_where)->field('count(*) as num,sum(pay_price) as price')->find();
|
|
|
|
|
|
$where_member1['create_time']= ['between', [mktime(0,0,0,date('m'),date('d'),date('Y')), time()]];
|
|
@@ -61,10 +80,19 @@ class Dashboard extends Backend
|
|
|
|
|
|
$where1['add_time'] = ['between', [mktime(0,0,0,date('m'),date('d'),date('Y')), time()]];
|
|
|
$where1['status']=array('in',['1','2','3']);
|
|
|
+ if (count($this->auth->suser_id)>0){
|
|
|
+ $where1['suser_id']=['in',$this->auth->suser_id];
|
|
|
+ }
|
|
|
+
|
|
|
$get_order1=StoreOrder::where($where1)->field('count(*) as num')->find();
|
|
|
|
|
|
$where2['add_time'] = ['between', [mktime(0,0,0,date('m'),date('d'),date('Y')), time()]];
|
|
|
$where2['status']=array('in',['1','-1']);
|
|
|
+
|
|
|
+
|
|
|
+ if (count($this->auth->suser_id)>0){
|
|
|
+ $where2['suser_id']=['in',$this->auth->suser_id];
|
|
|
+ }
|
|
|
$get_order2=StoreOrder::where($where2)->field('count(*) as num')->find();
|
|
|
|
|
|
|