优化平台币充值

master
chenzhi 4 years ago
parent fa9dc518d5
commit c0926299dc

@ -89,7 +89,7 @@ class DepositController extends ThinkController {
$sort = $data_order==3?'desc':'asc';
$map['order'] = $data_order_type.' '.$sort;
}
D(self::model_name)->addSubsiteWhere($map);
$map1=$map;
$map1['pay_status']=1;
@ -97,8 +97,12 @@ class DepositController extends ThinkController {
$total=null_to_0(D(self::model_name)->where($map1)->sum('pay_amount'));
$ttotal=null_to_0(D(self::model_name)->where('payed_time'.total(1))->where(array('pay_status'=>1))->sum('pay_amount'));
$ytotal=null_to_0(D(self::model_name)->where('payed_time'.total(5))->where(array('pay_status'=>1))->sum('pay_amount'));
$otherMap = ["pay_status"=>1];
D(self::model_name)->addSubsiteWhere($otherMap);
$ttotal=null_to_0(D(self::model_name)->where('payed_time'.total(1))->where($otherMap)->sum('pay_amount'));
$ytotal=null_to_0(D(self::model_name)->where('payed_time'.total(5))->where($otherMap)->sum('pay_amount'));
$this->assign('total',$total);
$this->assign('ttotal',$ttotal);
$this->assign('ytotal',$ytotal);

@ -1430,6 +1430,7 @@ class ExportController extends Controller
$map['merchant_id'] = $_REQUEST['merchant_id'];
unset($_REQUEST['merchant_id']);
}
D('Deposit')->addSubsiteWhere($map);
$map1 = $map;
$map1['pay_status'] = 1;

@ -36,11 +36,6 @@ class DepositModel extends Model {
public function __construct($name = '', $tablePrefix = '', $connection = '') {
/* 设置默认的表前缀 */
$this->tablePrefix ='tab_';
if(is_subsiteTable("tab_spend")){
//修改连接
$this->connection = SUBSITE_DB;
$connection = SUBSITE_DB;
}
/* 执行构造方法 */
parent::__construct($name, $tablePrefix, $connection);
}
@ -56,7 +51,20 @@ class DepositModel extends Model {
}
/**
* 添加子站点条件
* @param [arrary] $map
* @param string $alias spend数据库别名
* @return void
*/
public function addSubsiteWhere(&$map,$alias='')
{
$field = "partner_type";
!empty($alias) && $field = $alias.".".$field;
if(IS_SUBSITE){
$map[$field] = PARTNER_TYPE;
}
}
/*

Loading…
Cancel
Save