|
|
@@ -30,4 +30,23 @@ class GamePayChannelLogic extends BaseLogic
|
|
|
return Db::connect('db_center')->name('pay_channel')->where('status', 1)->select()->toArray();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 添加数据
|
|
|
+ * @param $data
|
|
|
+ * @return mixed
|
|
|
+ */
|
|
|
+ public function add($data): mixed
|
|
|
+ {
|
|
|
+ $gameId = $data['game_id'];
|
|
|
+ $result =$this->model->where('game_id',$gameId)->select();
|
|
|
+
|
|
|
+ if($result->isEmpty()){
|
|
|
+ $this->model->save($data);
|
|
|
+ }else{
|
|
|
+ throw new ApiException('该游戏支付渠道已存在');
|
|
|
+ }
|
|
|
+ return $this->model->getKey();
|
|
|
+ }
|
|
|
+
|
|
|
}
|