$type, ); $rows = myself()->_getSelfMysql()->execQuery($sql,$whereKv); if (!$rows){ $rows = array(); } return $rows; } public static function find($type){ if (!self::inspectType($type)){ return array(); } $row = SqlHelper::ormSelectOne (myself()->_getSelfMysql(), 't_rank_battle', array( 'account_id' => myself()->_getAccountId(), 'type' => $type, ) ); return $row ? $row : null; } public static function upsert($account,$type,$val){ if (!$account){ return; } SqlHelper::upsert (myself()->_getSelfMysql(), 't_rank_battle', array( 'account_id' => $account, 'type' => $type, ), array( 'value' => function () use($val) { return "value + ${val}"; }, 'modifytime' => myself()->_getNowTime(), ), array( 'account_id' => $account, 'channel' => phpcommon\extractChannel($account), 'type' => $type, 'value' => $val, 'createtime' => myself()->_getNowTime(), 'modifytime' => myself()->_getNowTime() ) ); } }