admin/app/common/services/goods/LeaseToyGoods.php

34 lines
661 B
PHP

<?php
namespace app\common\services\goods;
use app\common\components\BaseController;
use Yunshop\LeaseToy\models\LeaseToyGoodsModel;
use Setting;
/**
* Create 2018/3/5
* Author
*/
class LeaseToyGoods extends BaseController
{
public static function whetherEnabled()
{
$leaseToy = Setting::get('plugin.lease_toy');
if (app('plugins')->isEnabled('lease-toy')) {
if ($leaseToy['is_lease_toy']) {
return $leaseToy['is_lease_toy'];
}
}
return 0;
}
public static function getDate($goodsId)
{
return LeaseToyGoodsModel::whereGoodsId($goodsId)->first();
}
}