|
|
|
@ -51,11 +51,6 @@ class SpendModel extends Model
|
|
|
|
|
{
|
|
|
|
|
/* 设置默认的表前缀 */
|
|
|
|
|
$this->tablePrefix = 'tab_';
|
|
|
|
|
if(is_subsiteTable("tab_spend")){
|
|
|
|
|
//修改连接
|
|
|
|
|
$this->connection = SUBSITE_DB;
|
|
|
|
|
$connection = SUBSITE_DB;
|
|
|
|
|
}
|
|
|
|
|
/* 执行构造方法 */
|
|
|
|
|
parent::__construct($name, $tablePrefix, $connection);
|
|
|
|
|
}
|
|
|
|
@ -71,6 +66,20 @@ class SpendModel extends Model
|
|
|
|
|
$create_time = I('post.create_time');
|
|
|
|
|
return $create_time ? strtotime($create_time) : NOW_TIME;
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 添加子站点条件
|
|
|
|
|
* @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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function amdin_account()
|
|
|
|
|
{
|
|
|
|
@ -895,7 +904,7 @@ class SpendModel extends Model
|
|
|
|
|
}else{
|
|
|
|
|
$map['s.game_id'] = '-1';
|
|
|
|
|
}
|
|
|
|
|
$data = SM("Spend","tab_")
|
|
|
|
|
$data = M("Spend","tab_")
|
|
|
|
|
->alias('s')
|
|
|
|
|
->index('game_time')
|
|
|
|
|
->where(['s.pay_status' => 1])
|
|
|
|
@ -937,7 +946,7 @@ class SpendModel extends Model
|
|
|
|
|
$map['s.game_id'] = ['in', $gameIds];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$data = SM("Spend","tab_")
|
|
|
|
|
$data = M("Spend","tab_")
|
|
|
|
|
->alias('s')
|
|
|
|
|
->index('game_time')
|
|
|
|
|
->field("
|
|
|
|
|