You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.1 KiB
PHTML

<?php
namespace Admin\Controller;
/**
* 新功能之后还未来的急跑的脚本初始化数据
* @author chenzhi
*/
class OldCountController extends \Think\Controller
{
//超级签订单新增识别微信或者支付宝2019-12-11
public function gameSupersignPaywayInit()
{
$map = array(
"pay_status"=>1,
"pay_way"=>0
);
$GameSupersign = M("GameSupersign","tab_");
$dbres = $GameSupersign->field("id,trade_id")->where($map)->select();
$countdb = count($dbres);
if($countdb < 1){
die("No initialization required");
}
foreach ($dbres as $key => $value) {
$savedata = array(
"id"=>$value['id']
);
$tmp = (int)substr($value['trade_id'],0,4);
if($tmp > 3000){
$savedata['pay_way'] = 2; //微信
}else{
$savedata['pay_way'] = 1;//支付宝
}
$tres = $GameSupersign->save($savedata);
if($tres === false){
die("DB ERROR");
}
}
die("init ok");
}
}