国际跨国多语言婚恋找对象网站平台开发搭建 第十二篇

这篇博客主要介绍了财务模块的相关操作,包括系统消息的删除、信息模块的展示和现金发放管理。在删除操作中使用了事务处理确保数据一致性。此外,展示了现金发放的列表、编辑和审核功能,如微信、支付宝和话费充值的管理,以及提现审核的流程,包括失败后的退款操作和成功后的处理。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

由于最近事情太多了,没有更新文章,应该这篇是第十二篇了,接着前面更新的发完吧。

财务模块了,截图放出来给大家看看一下。

 代码部分
系统信息的操作

public function delMsg(){
        $id = input('post.id','','intval');
        // 启动事务
        Db::startTrans();
        try {
            $res = Db::name('systemmsg')->where(['msg_id'=>$id])->delete();
            if($res){
                return json(1);
            }
            // 提交事务
            Db::commit();
        } catch (\Exception $e) {
            // 回滚事务
            Db::rollback();
        }
    }

当前模块参数

public function _infoModule()

{

$data = array('info' => array('name' => '现金发放管理',

'description' => '管理网站现金发放信息',

),

'menu' => array(

array('name' => '现金发放列表',

'url' => U('Admin/Moeny/index'),

'icon' => 'list',

)

//$contentMenu

)

);

/*

$modelList = getAllService('ContentModel', '');

$contentMenu = array();

if (!empty($modelList))

{

$i = 0;

foreach ($modelList as $key => $value)

{

$i++;

$data['menu'][$i]['name'] = '添加' . $value['name'] . '分类';

$data['menu'][$i]['url'] = U($key . '/AdminBxcat/add');

$data['menu'][$i]['icon'] = 'plus';

}

}

*/

return $data;

}

/**

* 列表

*/

public function index()

{

$keyword = I('request.keyword','','trim');

$type =I('request.type','','intval');

$status =I('request.status','','intval');

$breadCrumb = array('现金发放列表' => U());

$this->assign('breadCrumb', $breadCrumb);

//$this->assign('list', D('User')->loadData());

$pageMaps = array();

$pageMaps['keyword'] = $keyword;

$pageMaps['type'] = $type;

$pageMaps['status'] = $status;

$where = array();

if(!empty($keyword)){

$where['_string'] = '(B.user_login like "%'.$keyword.'%") OR (A.uid = "'.$keyword.'")';

}

if(!empty($type)){

$where['A.type'] = $type;

}

if(!empty($status)){

$where['A.status'] = $status;

}

// $pageMaps['class_id'] = $classId;

// $pageMaps['position_id'] = $positionId;

//查询数据

$count = D('Tixian')->countList($where);

$limit = $this->getPageLimit($count,20);

//dump($limit);

$list = D('Tixian')->loadList($where,$limit);

$this->assign('pageMaps',$pageMaps);

$type =array(

1=>'微信',

2=>'支付宝',

3=>'话费充值',

);

$status =array(

0=>'失败',

1=>'成功',

2=>'审核中'

);

$this->assign('type',$type);

$this->assign('page',$this->getPageShow($pageMaps));

$this->assign('list',$list);

$this->assign('status',$status);

//print_r($list);

$this->adminDisplay();

}

/**

* 修改

*/

public function edit(){

if(!IS_POST){

$breadCrumb = array('列表'=>U('index'),'修改'=>U());

$this->assign('breadCrumb',$breadCrumb);

$Id = I('get.id','','intval');

if(empty($Id)) $this->error('参数不能为空!');

//获取记录

$info = M ( 'Tixian' )->where ( "id=$Id" )->find ();

if(!$info) $this->error('无数据!');

$type =array(

-1=>'后台操作',

1=>'分享文章送',

2=>'关注送',

3=>'分享好友送',

4=>'提现',

5=>'摇一摇',

);

$this->assign('info',$info);

$this->assign('type',$type);

$this->adminDisplay('info');

}else{

if(I('post.status')==1){

$res = A('Home/Site')->new_tixian(I('post.id'));

if($res!= 1) $this->error($res);

}

if(D('Tixian')->saveData('edit')){

$this->success('修改成功!');

}else{

$msg = D('Tixian')->getError();

if(empty($msg)){

$this->error('修改失败');

}else{

$this->error($msg);

}

}

}

}

//提现审核

public function tixian($id='',$status=0){

//if(empty($status)) $this->error('参数错误!');

$mod = D( 'Tixian' );

$info = $mod->where ( "id=".$id )->find ();

if(!$info) $this->error('无数据!');

$re = $mod ->editData($id,$status);

if($re){

switch ($status){

case 0:

$body ="金额".$info['fee']."元提现失败,已退".$info['fee']*C('moneyBL').C('money_name');

$res = $this->changemoney($info['uid'], $info['fee']*C('moneyBL'),101,$body,"","",1,get_client_ip(),0,101);

if($res){

$this->setSystemTj(array('txFlag'=>-1,'txFee'=>(-1)*$info['fee']));

$this->success('操作成功!');

}else{

$mod->where ( "id=$id" )->setField ('status',2);

$this->error('操作失败!');

}

break;

case 1:

if($info['status']==2){

$res =1;

if($info['type']==1){

$res = 0;

$res = $this->new_tixian($id,'admin');

}

if($res == 1){

$this->setSystemTj(array('txFlag'=>-1,'txFee'=>(-1)*$info['fee'],'txTotalFee'=>$info['fee'],'txTotalFeeDay'=>$info['fee']));

$this->success('操作成功!');

}else{

$mod->where ( "id=$id" )->setField ('status',2);

$this->error($res);

}

}

break;

}

}

$this->error('操作失败!');

}

public function clearmoney(){

$uid = I('post.uid');

$re = M("Users")->where("id=".$uid)->setField('money',0);

if($re){

$this->success("成功");

}else{

$this->error('失败');

}

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值