|
@@ -5,6 +5,7 @@ namespace app\common\model;
|
|
|
|
|
|
|
|
|
use app\admin\model\Orders;
|
|
|
+use think\Db;
|
|
|
use think\db\Query;
|
|
|
use think\Model;
|
|
|
|
|
@@ -25,4 +26,10 @@ class OrderGoods extends Model
|
|
|
Orders::whereRaw("orders.id={$table}.order_id and orders.admin_id=$admin_id")->buildSql()
|
|
|
);
|
|
|
}
|
|
|
+ public function scopeFilterDate(Query $query, $date, $column = 'create_time', $dateType = 'timestamp')
|
|
|
+ {
|
|
|
+ $query->whereExists(
|
|
|
+ Orders::where('id',Db::raw('order_goods.order_id'))->filterDate($date,$column,$dateType)->buildSql()
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|