|
@@ -15,7 +15,9 @@ class Card extends MY_Controller{
|
|
|
,'四星级概率'
|
|
|
,'五星级概率'
|
|
|
,'金卡数量(-1,不设限制)'
|
|
|
- ,'黑金卡数量(-1,不设限制)'];
|
|
|
+ ,'星光卡数量(-1,不设限制)'
|
|
|
+ ,'常规卡保底值'
|
|
|
+ ];
|
|
|
//宝箱类型
|
|
|
private $pro_type = [
|
|
|
1=>'木质宝箱',2=>'白银宝箱',3=>'黄金宝箱',
|
|
@@ -63,6 +65,7 @@ class Card extends MY_Controller{
|
|
|
'pro' => json_decode($v['star_pro'],true),
|
|
|
'maxGoldCard' => $v['maxGoldCard'],
|
|
|
'maxBlackGoldCard' => $v['maxBlackGoldCard'],
|
|
|
+ 'floorValue' => $v['floorValue'],
|
|
|
];
|
|
|
}
|
|
|
|
|
@@ -85,7 +88,7 @@ class Card extends MY_Controller{
|
|
|
$tb = otable::cardPro_Config();
|
|
|
foreach ($data as $row){
|
|
|
$temp = json_encode($row['data']);
|
|
|
- $rs = oo::commonOprDb('games')->query("UPDATE {$tb} SET star_pro='{$temp}',maxGoldCard='{$row['maxGoldCard']}',maxBlackGoldCard='{$row['maxBlackGoldCard']}' WHERE type={$row['type']}");
|
|
|
+ $rs = oo::commonOprDb('games')->query("UPDATE {$tb} SET star_pro='{$temp}',maxGoldCard='{$row['maxGoldCard']}',maxBlackGoldCard='{$row['maxBlackGoldCard']}',floorValue='{$row['floorValue']}' WHERE type={$row['type']}");
|
|
|
oo::commonOprRedis('games')->delete(okeys::CardTypePro($row['type']));
|
|
|
oo::commonOprRedis('games')->delete(okeys::MaxGoldCard($row['type']));
|
|
|
}
|
|
@@ -96,6 +99,32 @@ class Card extends MY_Controller{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 普卡保底值配置
|
|
|
+ */
|
|
|
+ public function floor()
|
|
|
+ {
|
|
|
+ $data['conf'] = oo::commonOprModel('config')->getCommonConf('CARD_FLOOR_CONF');
|
|
|
+ $this->load->view('card/floor', $data);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 普卡保底值配置--action
|
|
|
+ */
|
|
|
+ public function actionFloor()
|
|
|
+ {
|
|
|
+ $conf = array_values($this->input->post()['conf']);
|
|
|
+ $rs = oo::commonOprModel('config')->saveCommonConf('CARD_FLOOR_CONF', $conf, "普卡保底值配置");
|
|
|
+
|
|
|
+ oo::commonOprRedis('games')->delete("CARD_FLOOR_CONF");
|
|
|
+
|
|
|
+ if ($rs == 0) {
|
|
|
+ return $this->response(1, '操作失败');
|
|
|
+ } else {
|
|
|
+ return $this->response(0, '操作成功');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public function reward(){
|
|
|
$title = $this->reward_type;
|
|
|
$posts = $this->postData;
|
|
@@ -219,19 +248,45 @@ class Card extends MY_Controller{
|
|
|
$this->load->view('card/group', $data);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
//限时卡组主题配置
|
|
|
public function limitGroupTheme()
|
|
|
{
|
|
|
$data = [];
|
|
|
+ $langList = oo::cfg('lang')['lang_upper2'];
|
|
|
|
|
|
$tb = otable::cardgroup_limit_theme_config();
|
|
|
$sql = "SELECT * FROM {$tb} WHERE 1";
|
|
|
- $data['list'] = oo::commonOprDb('slavedb')->getAll($sql);
|
|
|
+ $list = oo::commonOprDb('slavedb')->getAll($sql);
|
|
|
|
|
|
- $tb2 = otable::cardgroup_config();
|
|
|
- $sql = "SELECT `cgid`,`cg_name_zh` FROM {$tb2} WHERE cg_type= 1";
|
|
|
+ foreach ($list as &$one) {
|
|
|
+ $one['cgids'] = json_decode($one['cgids'], true);
|
|
|
+ $one['lang'] = json_decode(empty($one['lang']) ? '[]' : $one['lang'], true);
|
|
|
+ $one['chests'] = json_decode(empty($one['chests']) ? '[]' : $one['chests'], true);
|
|
|
+ unset($one['last_opentime']);
|
|
|
+ }
|
|
|
+
|
|
|
+ $tb = otable::cardgroup_config();
|
|
|
+ $sql = "SELECT `cgid`,`cg_name_zh` FROM {$tb} WHERE cg_type= 1";
|
|
|
$data['cgidList'] = oo::commonOprDb('slavedb')->getAll($sql);
|
|
|
|
|
|
+
|
|
|
+ $tb = otable::ChestSkinConfig(2);
|
|
|
+ $sql = "SELECT `id`,`name`,`starPro` FROM {$tb}";
|
|
|
+ $ret = oo::commonOprDb('slavedb')->getAll($sql);
|
|
|
+
|
|
|
+ $chestList = [];
|
|
|
+ foreach ($ret as $oneChest) {
|
|
|
+ $starPro = json_decode($oneChest['starPro'], true);
|
|
|
+ if ($starPro['cardType'] == 1) {
|
|
|
+ $chestList[] = ['label' => $oneChest['name'], 'value' => $oneChest['id']];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $data['chestList'] = $chestList;
|
|
|
+ $data['list'] = $list;
|
|
|
+ $data['langList'] = $langList;
|
|
|
+
|
|
|
$this->load->view('card/limitGroupTheme', $data);
|
|
|
}
|
|
|
|
|
@@ -247,12 +302,15 @@ class Card extends MY_Controller{
|
|
|
|
|
|
foreach ($postData as $oneConfig) {
|
|
|
$id = $oneConfig['id'];
|
|
|
- $cgids = json_encode($oneConfig['cgids']??[], JSON_NUMERIC_CHECK);
|
|
|
+ $themeRes = $oneConfig['theme_res'];
|
|
|
+ $cgids = json_encode($oneConfig['cgids'] ?? [], JSON_NUMERIC_CHECK);
|
|
|
+ $chests = json_encode($oneConfig['chests'] ?? [], JSON_NUMERIC_CHECK);
|
|
|
+ $lang = json_encode($oneConfig['lang'] ?? [],JSON_UNESCAPED_UNICODE);
|
|
|
if (in_array($id, $idList)) {
|
|
|
- $sql = "UPDATE {$tb} SET theme_res='{$oneConfig['theme_res']}',cgids='{$cgids}' WHERE id={$id}";
|
|
|
+ $sql = "UPDATE {$tb} SET `theme_res`='$themeRes',`cgids`='$cgids',`chests`='$chests',`lang`='$lang' WHERE id={$id}";
|
|
|
oo::commonOprRedis('games')->delete(okeys::limitGroupCardThemeConfig($id));
|
|
|
} else {
|
|
|
- $sql = "INSERT INTO {$tb} (`id`,`theme_res`, `cgids`) VALUES ({$id},'{$oneConfig['theme_res']}','{$cgids}')";
|
|
|
+ $sql = "INSERT INTO {$tb} (`id`,`theme_res`, `cgids`, `chests`, `lang`) VALUES ({$id},'{$themeRes}','{$cgids}','{$chests}','{$lang}')";
|
|
|
}
|
|
|
|
|
|
$flag = oo::commonOprDb('games')->query($sql);
|
|
@@ -260,9 +318,18 @@ class Card extends MY_Controller{
|
|
|
return $this->response(1, '操作失败');
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ $filename = 'LimitGroupTheme' . time() . '.json';
|
|
|
+
|
|
|
+ oo::commonOprModel("json")->SaveJson($postData, $filename);
|
|
|
+ oo::commonOprModel("json")->setStaticConfig("LimitGroupTheme", $filename);
|
|
|
+
|
|
|
+ $this->actionSyncJson();
|
|
|
+
|
|
|
return $this->response(0, '操作成功');
|
|
|
}
|
|
|
|
|
|
+
|
|
|
public function exclusivegroup(){
|
|
|
$title = [
|
|
|
'卡组ID'
|
|
@@ -352,7 +419,7 @@ class Card extends MY_Controller{
|
|
|
$title[] = '卡片星级';
|
|
|
$title[] = '解锁等级';
|
|
|
$title[] = '图片ID';
|
|
|
- $title[] = '金卡(1普通2金3黑金)';
|
|
|
+ $title[] = '金卡(1普通2金3星光)';
|
|
|
$title[] = '权重';
|
|
|
$title[] = '配图';
|
|
|
// $title[] = '上传图片';
|