glhcp/server/app/common/model/shop/ShopApply.php

87 lines
2.5 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\common\model\shop;
use app\common\basics\Models;
use app\common\server\UrlServer;
/**
* 商家申请入驻模型
* Class ShopApply
* @package app\common\model\shop
*/
class ShopApply extends Models
{
/**
* NOTE: 关联主营类目模型
* @author 张无忌
*/
public function category()
{
return $this->hasOne('ShopCategory', 'id', 'cid');
}
/**
* NOTE: 获取器-申请时间
* @param $value
* @return false|string
* @author: 张无忌
*/
public function getApplyTimeAttr($value)
{
return date('Y-m-d H:i:s', $value);
}
/**
* @Notes: 修改器-营业执照
* @Author: 张无忌
* @param $value
*/
// public function setLicenseAttr($value)
// {
// foreach ($value as &$url) {
// UrlServer::setFileUrl($url);
// }
// }
/**
* @Notes: 获取器-营业执照
* @Author: 张无忌
* @param $value
* @return array
*/
public function getLicenseAttr($value)
{
$result = $value ? explode(',', $value) : [];
foreach ($result as &$url) {
UrlServer::getFileUrl($url);
}
return $result;
}
public function getAuditStatusDescAttr($value)
{
$desc = [1=>'待审核',2=>'审核通过',3=>'审核拒绝'];
return $desc[$value];
}
}