|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
namespace app\admin\controller\seller;
|
|
|
|
|
|
+use app\admin\model\AdminMoneyLog;
|
|
|
use app\admin\model\OrderInfo;
|
|
|
use app\admin\model\Orders;
|
|
|
use app\common\controller\Backend;
|
|
@@ -53,7 +54,19 @@ class MyTeam extends Backend
|
|
|
|
|
|
public function profit_static(){
|
|
|
list($date,$dateArr)=$this->rangeTime('date');
|
|
|
+ $sale=AdminMoneyLog::filterDate($dateArr)
|
|
|
+ ->filterTypeCommission()
|
|
|
+ ->where('admin_id',$this->admin('id'))
|
|
|
+ ->sum('amount');
|
|
|
+ $goods=OrderInfo::whereExists(
|
|
|
+ AdminMoneyLog::whereRaw("admin_money_log.target_id=order_info.order_id")->where('admin_id',$this->admin('id'))->filterDate($dateArr)->buildSql()
|
|
|
+ )
|
|
|
+ ->group('goods_id')
|
|
|
+ ->field('sum(amount_pay) as num,goods_name')
|
|
|
+ ->select();
|
|
|
+ $this->assign('goods',$goods);
|
|
|
$this->assign('date',$date);
|
|
|
+ $this->assign('sale',$sale);
|
|
|
return $this->fetch();
|
|
|
}
|
|
|
}
|