1
This commit is contained in:
parent
db9cfb4586
commit
6e2d2bc88b
@ -20,12 +20,6 @@ class FirstTopupController extends BaseAuthedController
|
|||||||
{
|
{
|
||||||
$complete = false;
|
$complete = false;
|
||||||
|
|
||||||
// $address = myself()->_getAddress();
|
|
||||||
// if (!$address) {
|
|
||||||
// $this->_rspErr(1, 'you have not a web3 address');
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
$conn = myself()->_getMysql('');
|
$conn = myself()->_getMysql('');
|
||||||
|
|
||||||
$status = $this->getStatusFromDB($conn);
|
$status = $this->getStatusFromDB($conn);
|
||||||
@ -223,4 +217,5 @@ class FirstTopupController extends BaseAuthedController
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -7,29 +7,31 @@ use phpcommon\SqlHelper;
|
|||||||
|
|
||||||
class FirstTopup extends BaseModel {
|
class FirstTopup extends BaseModel {
|
||||||
|
|
||||||
public static function find()
|
public static function get()
|
||||||
{
|
{
|
||||||
$row = SqlHelper::ormSelectOne(
|
$row = SqlHelper::ormSelectOne(
|
||||||
myself()->_getMysql(''),
|
myself()->_getSelfMysql(),
|
||||||
't_first_topup',
|
't_first_topup',
|
||||||
array(
|
array(
|
||||||
'order_id' => $orderId,
|
'account_id' => myself()->_getAccountId(),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return $row;
|
return $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function add($orderId, $platform, $goodsId, $price)
|
public static function add($accountId)
|
||||||
{
|
{
|
||||||
SqlHelper::insert(
|
SqlHelper::upsert(
|
||||||
myself()->_getMysql(''),
|
myself()->_getMysql($accountId),
|
||||||
't_first_topup',
|
't_first_topup',
|
||||||
array(
|
array(
|
||||||
'order_id' => $orderId,
|
'account_id' => $accountId,
|
||||||
'account_id' => myself()->_getAccountId(),
|
),
|
||||||
'platform' => $platform,
|
array(
|
||||||
'goods_id' => $goodsId,
|
|
||||||
'price' => $price,
|
),
|
||||||
|
array(
|
||||||
|
'account_id' => $accountId,
|
||||||
'createtime' => myself()->_getNowTime(),
|
'createtime' => myself()->_getNowTime(),
|
||||||
'modifytime' => myself()->_getNowTime(),
|
'modifytime' => myself()->_getNowTime(),
|
||||||
)
|
)
|
||||||
@ -39,10 +41,10 @@ class FirstTopup extends BaseModel {
|
|||||||
public static function update($orderId, $fieldsKv)
|
public static function update($orderId, $fieldsKv)
|
||||||
{
|
{
|
||||||
SqlHelper::update(
|
SqlHelper::update(
|
||||||
myself()->_getMysql(''),
|
myself()->_getSelfMysql(),
|
||||||
't_first_topup',
|
't_first_topup',
|
||||||
array(
|
array(
|
||||||
'order_id' => $orderId
|
'account_id' => myself()->_getAccountId()
|
||||||
),
|
),
|
||||||
$fieldsKv
|
$fieldsKv
|
||||||
);
|
);
|
||||||
|
@ -7,6 +7,7 @@ require_once("mt/Item.php");
|
|||||||
|
|
||||||
require_once("models/ShopBuyRecord.php");
|
require_once("models/ShopBuyRecord.php");
|
||||||
require_once("models/OutAppOrder.php");
|
require_once("models/OutAppOrder.php");
|
||||||
|
require_once("models/FirstTopup.php");
|
||||||
|
|
||||||
require_once("services/LogService.php");
|
require_once("services/LogService.php");
|
||||||
require_once("ShopAddItemService.php");
|
require_once("ShopAddItemService.php");
|
||||||
@ -15,6 +16,7 @@ use phpcommon\SqlHelper;
|
|||||||
|
|
||||||
use models\ShopBuyRecord;
|
use models\ShopBuyRecord;
|
||||||
use models\OutAppOrder;
|
use models\OutAppOrder;
|
||||||
|
use models\FirstTopup;
|
||||||
|
|
||||||
use services\LogService;
|
use services\LogService;
|
||||||
|
|
||||||
@ -68,7 +70,7 @@ class OutAppPurchase {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
OutAppOrder::markFinished($orderDb['order_id']);
|
OutAppOrder::markFinished($orderDb['order_id']);
|
||||||
$this->beginFirstTupop($address);
|
FirstTopup::add($accountId);
|
||||||
// 以下是看商品表中是否配置了充值额外奖励
|
// 以下是看商品表中是否配置了充值额外奖励
|
||||||
$goodsMeta = mt\ShopGoods::get($orderDb['goods_id']);
|
$goodsMeta = mt\ShopGoods::get($orderDb['goods_id']);
|
||||||
if (!$goodsMeta) {
|
if (!$goodsMeta) {
|
||||||
@ -99,38 +101,6 @@ class OutAppPurchase {
|
|||||||
$this->_rspOk();
|
$this->_rspOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function beginFirstTupop($address)
|
|
||||||
{
|
|
||||||
$conn = myself()->_getMysql('');
|
|
||||||
|
|
||||||
$exist = SqlHelper::selectOne(
|
|
||||||
$conn,
|
|
||||||
't_first_topup',
|
|
||||||
array('address'),
|
|
||||||
array('address' => $address)
|
|
||||||
);
|
|
||||||
if ($exist) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 开始首充奖励活动进程
|
|
||||||
$chk = SqlHelper::insert(
|
|
||||||
$conn,
|
|
||||||
't_first_topup',
|
|
||||||
array(
|
|
||||||
'address' => $address,
|
|
||||||
'createtime' => myself()->_getNowTime(),
|
|
||||||
'status1' => 0,
|
|
||||||
'status2' => 0,
|
|
||||||
'status3' => 0,
|
|
||||||
)
|
|
||||||
);
|
|
||||||
if (!$chk) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private function verifySign()
|
private function verifySign()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user