application/app/controller/Platform.php

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php
/**
 * 易想会员管理营销系统
 * =========================================================
 * 天津市华易动力信息科技有限公司 , 保留所有权利。
 * ----------------------------------------------
 * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
 * 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
 * =========================================================
 * @author : hy_team
 * @date : 2019-08-10
 */
namespace app\app\controller;

use app\common\controller\CommonApp;
use app\common\model\Coupon;
use app\common\model\CouponMember;
use app\common\model\Members;
use app\common\service\Coupon as CouponService;

/**
 * 领券中心
 */
class Platform extends CommonApp
{
	public function index()
	{	

		$coupon_id = intval(cookie_decrypt($this->request->param('token'),'HY_COUPON'));
		if (!is_numeric($coupon_id) || $coupon_id < 0 || empty($coupon_id)) {
			$this->error('参数错误');
		}
		$coupon_usernum = CouponMember::where('coupon_id',$coupon_id)->count();
		$couponRow = Coupon::where('id',$coupon_id)->find();
		$num=$couponRow['total_num']-$coupon_usernum;

		$error='';
		if($couponRow['expire_time']<=time()){
			$error='优惠券已过期';	
		}
		if($couponRow['status']!=1){
			$error='优惠券不可用';
		}
		if($num<=0){
			$error='优惠券已领完!';
		}

		$params = [
			'coupon_id'	=>	$coupon_id
		];
		if ($this->request->isAjax()) {
			$mobile = $this->request->param('mobile');
			if (!$mobile) {
				return '手机号不存在';
			}
			$get_member = Members::where('mobile',$mobile)->find();
			if ($get_member) {
				$params['uid'] = $get_member['id'];
			}else{
				$params['mobile'] = $mobile;
后面还有 16 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。