mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2026-07-07 14:25:32 +08:00
消息数据转换
This commit is contained in:
@ -396,5 +396,54 @@ class Devtest extends Common
|
||||
}
|
||||
echo 'count:'.count($data).', success:'.$success.', fail:'.$fail;
|
||||
}
|
||||
|
||||
/**
|
||||
* 消息数据处理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-07-26
|
||||
* @desc description
|
||||
*/
|
||||
public function MessageHandle()
|
||||
{
|
||||
if(input('pwd') != 'shopxo520')
|
||||
{
|
||||
die('非法访问');
|
||||
}
|
||||
|
||||
// 状态
|
||||
$success = 0;
|
||||
$fail = 0;
|
||||
|
||||
|
||||
// 获取日志
|
||||
$data = Db::name('Message')->where(['is_handle'=>0])->limit(0, 500)->select();
|
||||
if(!empty($data))
|
||||
{
|
||||
$business_type_list = [
|
||||
0 => '默认',
|
||||
1 => '订单',
|
||||
2 => '充值',
|
||||
3 => '提现',
|
||||
];
|
||||
foreach($data as $v)
|
||||
{
|
||||
$upd_data = [
|
||||
'is_handle' => 1,
|
||||
'business_type' => isset($business_type_list[$v['business_type']]) ? $business_type_list[$v['business_type']] : $v['business_type'],
|
||||
];
|
||||
|
||||
// 更新操作
|
||||
if(Db::name('Message')->where(['is_handle'=>0, 'id'=>$v['id']])->update($upd_data))
|
||||
{
|
||||
$success++;
|
||||
} else {
|
||||
$fail++;
|
||||
}
|
||||
}
|
||||
}
|
||||
echo 'count:'.count($data).', success:'.$success.', fail:'.$fail;
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user