您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息
免费发信息
三六零分类信息网 > 临夏分类信息网,免费分类信息发布

WeMall微信商城源码插件代金券部分代码

2024/3/4 21:41:30发布34次查看
wemall微信商城源码插件coupon代金券代码是用于商业推广的比较有效的方式,分享了部分比较重要的代码,供技术员学习参考
wemall微信商城源码插件coupon代金券代码是用于商业推广的比较有效的方式,分享了部分比较重要的代码,供技术员学习参考
admincontroller.class.php
getpageconditionorder($p, $num, id desc);  
        $this->assign(couponlist, $coupon);// 赋值数据集
$count = $couponmodel->getcount();// 查询满足要求的总记录数  
        $page = new \think\page($count, $num);// 实例化分页类 传入总记录数和每页显示的记录数  
        $page->setconfig(’theme’, %first%%up_page%%link_page%%down_page%%end% %header%  %now_page%/%total_page% 页);  
        $show = $page->show();// 分页显示输出  
        $this->assign(’page’, $show);// 赋值分页输出
$this->display(); // 输出模板  
    }
public function add()  
    {  
        if (is_post) {  
            if (!i(post.name)) {  
                return;  
            }
$data = i(post.);  
            $data[’last_time’] = i(’post.last_time’, ’’, ’strtotime’);  
            $coupon_id = d(’addons://coupon/addoncouponmenu’)->addcouponmenu($data);
isset($coupon_id) ? $this->success(’添加成功’, ’admin/admin/index/addon/coupon’) : $this->error(’添加失败’, u_addons(coupon://admin/admin/index));  
        } else {  
            $this->display(); // 输出模板  
        }  
    }
public function detail()  
    {  
        $cdata[’coupon_menu_id’] = i(’get.id’);  
        $m = m(’addoncoupon’);  
        $count = $m->where($cdata)->count(); // 查询满足要求的总记录数  
        $page = new \think\page ($count, 15); // 实例化分页类 传入总记录数和每页显示的记录数  
        $page->setconfig(’theme’, %first%%up_page%%link_page%%down_page%%end% %header%  %now_page%/%total_page% 页);  
        $show = $page->show(); // 分页显示输出  
        $detail = $m->where($cdata)->limit($page->firstrow . ’,’ . $page->listrows)->select();
$this->assign(page, $show); // 赋值分页输出  
        $this->assign(’coupon’, $detail);  
        $this->display();  
    }
public function export()  
    {
}
public function del()  
    {  
        $cdata[’coupon_menu_id’] = $data[’id’] = i(’get.id’);  
        $c = m(’addoncouponmenu’)->where($data)->delete();  
        $m = m(’addoncoupon’)->where($cdata)->delete();  
        if ($c != false && $m != false) {  
            $this->success(’删除成功’, ’admin/admin/index/addon/coupon’);  
        } else {  
            $this->error(’操作失败’, ’admin/admin/index/addon/coupon’);  
        }  
    }
public function detail_del()  
    {  
        $cdata[’id’] = i(’get.id’);  
        $m = m(’addoncoupon’)->where($cdata)->delete();  
        if ($m != false) {  
            $this->success(’删除成功’, ’admin/admin/index/addon/coupon’);  
        } else {  
            $this->error(’操作失败’, ’admin/admin/index/addon/coupon’);  
        }  
    }  
}  
addoncouponmenumodel.class.php
count();  
        return $count;  
    }
public function getpageconditionorder($p = 1, $num = 1, $order)  
    {  
        // 进行分页数据查询 注意page方法的参数的前面部分是当前的页数使用 $_get[p]获取  
        $orderlist = $this->page($p . ’,’ . $num . ’’)->order($order)->select();  
        return $orderlist;  
    }
public function addcouponmenu($data)  
    {  
        $data[’ctime’] = time();  
        $number = $data[’num’] = intval($data[’num’]);  
        $data[’coupon_menu_id’] = $this->add($data);
for ($i = 0; $i             $data[’code’] = rand_code(6);  
            $code = m(’addoncoupon’)->where(array(’code’ => $data[’code’]))->find();  
            if (!isset($code)) {  
                $coupon_id = m(’addoncoupon’)->add($data);  
            } else {  
                $number = $number + 1;  
            }  
        }  
        return $coupon_id;  
    }  
}   admin_detail.html
优惠券管理
优惠券管理
返回优惠券列表页
id  
                                优惠码  
                                金额  
                                状态  
                                截止时间  
                                操作
{$coupon.id}
{$coupon.code}
{$coupon.price}
{$coupon.status}
{:date(’y-m-d h:i:s’,$coupon[’last_time’])}
href={:u_addons(\’coupon://admin/admin/detail_del\’,array(’id’=>$coupon[’id’]))}>删除
{$page}
代码来源: www.wemallshop.com
coupon代金券.rar ( 8.65 kb 下载:2 次 )
临夏分类信息网,免费分类信息发布

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录