xieruidong 2 years ago
parent
commit
8e011e425c
2 changed files with 8 additions and 1 deletions
  1. 1 1
      application/admin/controller/Overview.php
  2. 7 0
      application/common/model/Refund.php

+ 1 - 1
application/admin/controller/Overview.php

@@ -79,7 +79,7 @@ class Overview extends Backend
         $buy = Db('Orders')->where($where)->where('status','in','5,10,20')->group('user_id')->count();
 
         #投诉量
-        $tsNum=Refund::filterDate($postTimeArr)->count();
+        $tsNum=Refund::filterDate($postTimeArr)->filterTs()->count();
         $this->assign('tsNum',$tsNum);
 
         //毛利、毛利率

+ 7 - 0
application/common/model/Refund.php

@@ -12,6 +12,7 @@ use think\Model;
  * @property User user
  * @property int refund_status
  * @method static static|Query FilterRefund()
+ * @method static static|Query FilterTs()
  */
 class Refund Extends Model
 {
@@ -204,6 +205,12 @@ class Refund Extends Model
     public function scopeFilterRefund(Query $query){
         $query->whereBetween("{$this->getTable()}.refund_status",[self::REFUND_ING,self::REFUND_PASS]);
     }
+    /**
+     * 投诉类型的售后
+     */
+    public function scopeFilterTs(Query $query){
+        $query->where("{$this->getTable()}.reason1",self::REASON_QU);
+    }