application/admin/controller/coupon/Set.php

(开头部分) 12KB

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

<?php

namespace app\admin\controller\balance;
use app\common\controller\Common;
use app\common\model\Balance;
use app\common\model\BalanceMember;
use app\common\model\Store;
use app\common\model\BalanceRechargeRules as BalanceRechargeRules;
use app\common\model\Coupon;
use app\common\service\Coupon as couponService;

class Set extends Common
{
	// 余额卡设置
	public function index(){
		$list = Balance::order("id","desc")->paginate(20,false);
		$storeList = Store::column("name","id");

		foreach($list as &$value){
			$storeNames = "";
			if($value["store_ids"] != "all"){
				$store_ids_arr = explode(",",$value["store_ids"]);
				foreach($store_ids_arr as $val){
					$storeNames .= $storeList[$val] . " ";
				}
			}else{
				$storeNames = "全部门店";
			}
			$value["store_name"] = $storeNames;
			$value["balance_num"] = BalanceMember::where("balance_id",$value["id"])->count();
		}

		return view("",["list" => $list]);
	}

	// 添加余额卡
	public function add(){

		if(check_form_token() && $this->request->ispost()){ //表达提交
			$data = input("post.");

			$balance = new Balance();
			
			$verify_res = com_validate($balance->rule,$balance->msg,$data);//验证器

			if (isset($verify_res['errcode']) && $verify_res['errcode'] == 0) {


				if(empty($data['store_id'])){
					$this -> error("适用门店不能为空");
				}elseif($data["store_id"][0] == "all"){
					$data["store_ids"] == "all";
				}else{
					$data["store_ids"] = implode(",",$data['store_id']);
				}

				if(empty($data['time_status'])){
					$this -> error("有效期类型不能为空");
				}elseif($data['time_status'] == 2){
					if(empty($data['date_time'])){
后面还有 392 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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