You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
GeekQu_sspanel/app/Models/Coupon.php

32 lines
588 B
PHTML

9 years ago
<?php
namespace App\Models;
class Coupon extends Model
{
protected $connection = 'default';
protected $table = 'coupon';
8 years ago
9 years ago
public function expire()
{
return date('Y-m-d H:i:s', $this->attributes['expire']);
9 years ago
}
public function order($shop)
{
if ($this->attributes['shop'] == '') {
9 years ago
return true;
}
8 years ago
$shop_array = explode(',', $this->attributes['shop']);
8 years ago
9 years ago
foreach ($shop_array as $shopid) {
8 years ago
if ($shopid == $shop) {
9 years ago
return true;
}
}
8 years ago
9 years ago
return false;
}
}