From 0c4c0a789d53232495961f9b263532542d74b3c7 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 2 Aug 2023 16:41:13 +0800 Subject: [PATCH] 1 --- sql/gamedb.sql | 1 + webapp/controller/ShopController.class.php | 7 +++++++ webapp/models/OutAppOrder.php | 20 +++++++++++++++++++- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/sql/gamedb.sql b/sql/gamedb.sql index fea8dc19..53d43aff 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -1361,6 +1361,7 @@ CREATE TABLE `t_outapp_order` ( `address` varchar(60) DEFAULT NULL COMMENT '申请时账号绑定的钱包', `goods_id` int(11) NOT NULL DEFAULT '0' COMMENT '物品id', `price` double NOT NULL DEFAULT '0' COMMENT '价格', + `params` mediumblob COMMENT 'params', `status` int(11) NOT NULL DEFAULT '0' COMMENT 'status', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index 86de9285..b83750c4 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -227,6 +227,13 @@ class ShopController extends BaseAuthedController { $orderId, $nowTime ); + OutAppOrder::add( + $orderId, + $platform, + $goodsId, + $price, + json_encode($params) + ); /* 签名方式:将所有的参数用&连接起来做md5加secret_key */ diff --git a/webapp/models/OutAppOrder.php b/webapp/models/OutAppOrder.php index 6f632737..9c6b7474 100644 --- a/webapp/models/OutAppOrder.php +++ b/webapp/models/OutAppOrder.php @@ -14,7 +14,7 @@ class OutAppOrder extends BaseModel { public static function find($orderId) { $row = SqlHelper::ormSelectOne( - myself()->_get(), + myself()->_getMysql(''), 't_outapp_order', array( 'order_id' => $orderId, @@ -23,6 +23,24 @@ class OutAppOrder extends BaseModel { return $row; } + public static function add($orderId, $platform, $goodsId, $price, $paramsJson) + { + SqlHelper::insert( + myself()->_getMysql(''), + 't_outapp_order', + array( + 'order_id' => $orderId, + 'account_id' => myself()->_getAccountId(), + 'platform' => $platform, + 'goods_id' => $goodsId, + 'price' => $price, + 'params' => $paramsJson, + 'createtime' => myself()->_getNowTime(), + 'modifytime' => myself()->_getNowTime(), + ) + ); + } + public static function markFinished($orderId) { SqlHelper::update(