parent
b79abdd5c8
commit
2581489402
@ -0,0 +1,8 @@ |
||||
# 默认忽略的文件 |
||||
/shelf/ |
||||
/workspace.xml |
||||
# 基于编辑器的 HTTP 客户端请求 |
||||
/httpRequests/ |
||||
# Datasource local storage ignored files |
||||
/dataSources/ |
||||
/dataSources.local.xml |
@ -0,0 +1,15 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project version="4"> |
||||
<component name="PublishConfigData" autoUpload="On explicit save action" serverName="1" remoteFilesAllowedToDisappearOnAutoupload="false"> |
||||
<serverData> |
||||
<paths name="1"> |
||||
<serverdata> |
||||
<mappings> |
||||
<mapping deploy="/" local="$PROJECT_DIR$" web="/" /> |
||||
</mappings> |
||||
</serverdata> |
||||
</paths> |
||||
</serverData> |
||||
<option name="myAutoUpload" value="ON_EXPLICIT_SAVE" /> |
||||
</component> |
||||
</project> |
@ -0,0 +1,8 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project version="4"> |
||||
<component name="ProjectModuleManager"> |
||||
<modules> |
||||
<module fileurl="file://$PROJECT_DIR$/.idea/shipin.iml" filepath="$PROJECT_DIR$/.idea/shipin.iml" /> |
||||
</modules> |
||||
</component> |
||||
</project> |
@ -0,0 +1,101 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project version="4"> |
||||
<component name="PhpIncludePathManager"> |
||||
<include_path> |
||||
<path value="$PROJECT_DIR$/vendor/fastknife/ajcaptcha" /> |
||||
<path value="$PROJECT_DIR$/vendor/alipaysdk/easysdk" /> |
||||
<path value="$PROJECT_DIR$/vendor/godruoyi/php-snowflake" /> |
||||
<path value="$PROJECT_DIR$/vendor/danielstjules/stringy" /> |
||||
<path value="$PROJECT_DIR$/vendor/mtdowling/jmespath.php" /> |
||||
<path value="$PROJECT_DIR$/vendor/grpc/grpc" /> |
||||
<path value="$PROJECT_DIR$/vendor/doctrine/cache" /> |
||||
<path value="$PROJECT_DIR$/vendor/doctrine/lexer" /> |
||||
<path value="$PROJECT_DIR$/vendor/overtrue/wechat" /> |
||||
<path value="$PROJECT_DIR$/vendor/doctrine/annotations" /> |
||||
<path value="$PROJECT_DIR$/vendor/qcloud_sts/qcloud-sts-sdk" /> |
||||
<path value="$PROJECT_DIR$/vendor/overtrue/socialite" /> |
||||
<path value="$PROJECT_DIR$/vendor/qcloud/cos-sdk-v5" /> |
||||
<path value="$PROJECT_DIR$/vendor/phpoffice/phpspreadsheet" /> |
||||
<path value="$PROJECT_DIR$/vendor/volcengine/volc-sdk-php" /> |
||||
<path value="$PROJECT_DIR$/vendor/guzzlehttp/psr7" /> |
||||
<path value="$PROJECT_DIR$/vendor/guzzlehttp/promises" /> |
||||
<path value="$PROJECT_DIR$/vendor/guzzlehttp/guzzle" /> |
||||
<path value="$PROJECT_DIR$/vendor/markbaker/matrix" /> |
||||
<path value="$PROJECT_DIR$/vendor/markbaker/complex" /> |
||||
<path value="$PROJECT_DIR$/vendor/qiniu/php-sdk" /> |
||||
<path value="$PROJECT_DIR$/vendor/xaboy/form-builder" /> |
||||
<path value="$PROJECT_DIR$/vendor/xin/container" /> |
||||
<path value="$PROJECT_DIR$/vendor/xin/helper" /> |
||||
<path value="$PROJECT_DIR$/vendor/league/flysystem" /> |
||||
<path value="$PROJECT_DIR$/vendor/league/mime-type-detection" /> |
||||
<path value="$PROJECT_DIR$/vendor/myclabs/php-enum" /> |
||||
<path value="$PROJECT_DIR$/vendor/topthink/think-queue" /> |
||||
<path value="$PROJECT_DIR$/vendor/alibabacloud/iot-20180120" /> |
||||
<path value="$PROJECT_DIR$/vendor/topthink/think-view" /> |
||||
<path value="$PROJECT_DIR$/vendor/alibabacloud/dysmsapi-20170525" /> |
||||
<path value="$PROJECT_DIR$/vendor/symfony/translation-contracts" /> |
||||
<path value="$PROJECT_DIR$/vendor/composer" /> |
||||
<path value="$PROJECT_DIR$/vendor/topthink/think-helper" /> |
||||
<path value="$PROJECT_DIR$/vendor/alibabacloud/darabonba-openapi" /> |
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" /> |
||||
<path value="$PROJECT_DIR$/vendor/topthink/think-migration" /> |
||||
<path value="$PROJECT_DIR$/vendor/alibabacloud/endpoint-util" /> |
||||
<path value="$PROJECT_DIR$/vendor/symfony/translation" /> |
||||
<path value="$PROJECT_DIR$/vendor/topthink/think-factory" /> |
||||
<path value="$PROJECT_DIR$/vendor/alibabacloud/tea-utils" /> |
||||
<path value="$PROJECT_DIR$/vendor/symfony/var-dumper" /> |
||||
<path value="$PROJECT_DIR$/vendor/topthink/think-captcha" /> |
||||
<path value="$PROJECT_DIR$/vendor/alibabacloud/credentials" /> |
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php72" /> |
||||
<path value="$PROJECT_DIR$/vendor/topthink/think-filesystem" /> |
||||
<path value="$PROJECT_DIR$/vendor/alibabacloud/gateway-spi" /> |
||||
<path value="$PROJECT_DIR$/vendor/symfony/psr-http-message-bridge" /> |
||||
<path value="$PROJECT_DIR$/vendor/topthink/framework" /> |
||||
<path value="$PROJECT_DIR$/vendor/alibabacloud/linkvisual-20180120" /> |
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-normalizer" /> |
||||
<path value="$PROJECT_DIR$/vendor/topthink/think-orm" /> |
||||
<path value="$PROJECT_DIR$/vendor/alibabacloud/tea-fileform" /> |
||||
<path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher" /> |
||||
<path value="$PROJECT_DIR$/vendor/topthink/think-template" /> |
||||
<path value="$PROJECT_DIR$/vendor/alibabacloud/tea-xml" /> |
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-idn" /> |
||||
<path value="$PROJECT_DIR$/vendor/topthink/think-image" /> |
||||
<path value="$PROJECT_DIR$/vendor/alibabacloud/openapi-util" /> |
||||
<path value="$PROJECT_DIR$/vendor/guzzle/guzzle" /> |
||||
<path value="$PROJECT_DIR$/vendor/symfony/http-foundation" /> |
||||
<path value="$PROJECT_DIR$/vendor/topthink/think-multi-app" /> |
||||
<path value="$PROJECT_DIR$/vendor/alibabacloud/tea" /> |
||||
<path value="$PROJECT_DIR$/vendor/symfony/process" /> |
||||
<path value="$PROJECT_DIR$/vendor/dh2y/think-qrcode" /> |
||||
<path value="$PROJECT_DIR$/vendor/pimple/pimple" /> |
||||
<path value="$PROJECT_DIR$/vendor/intervention/image" /> |
||||
<path value="$PROJECT_DIR$/vendor/spatie/macroable" /> |
||||
<path value="$PROJECT_DIR$/vendor/google/longrunning" /> |
||||
<path value="$PROJECT_DIR$/vendor/lizhichao/one-sm" /> |
||||
<path value="$PROJECT_DIR$/vendor/google/gax" /> |
||||
<path value="$PROJECT_DIR$/vendor/lizhichao/word" /> |
||||
<path value="$PROJECT_DIR$/vendor/google/protobuf" /> |
||||
<path value="$PROJECT_DIR$/vendor/google/grpc-gcp" /> |
||||
<path value="$PROJECT_DIR$/vendor/aws/aws-sdk-php" /> |
||||
<path value="$PROJECT_DIR$/vendor/google/auth" /> |
||||
<path value="$PROJECT_DIR$/vendor/google/common-protos" /> |
||||
<path value="$PROJECT_DIR$/vendor/ralouphie/getallheaders" /> |
||||
<path value="$PROJECT_DIR$/vendor/adbario/php-dot-notation" /> |
||||
<path value="$PROJECT_DIR$/vendor/songshenzong/support" /> |
||||
<path value="$PROJECT_DIR$/vendor/workerman/crontab" /> |
||||
<path value="$PROJECT_DIR$/vendor/workerman/channel" /> |
||||
<path value="$PROJECT_DIR$/vendor/aliyuncs/oss-sdk-php" /> |
||||
<path value="$PROJECT_DIR$/vendor/monolog/monolog" /> |
||||
<path value="$PROJECT_DIR$/vendor/workerman/workerman" /> |
||||
<path value="$PROJECT_DIR$/vendor/psr/http-message" /> |
||||
<path value="$PROJECT_DIR$/vendor/psr/simple-cache" /> |
||||
<path value="$PROJECT_DIR$/vendor/nesbot/carbon" /> |
||||
<path value="$PROJECT_DIR$/vendor/psr/log" /> |
||||
<path value="$PROJECT_DIR$/vendor/psr/cache" /> |
||||
<path value="$PROJECT_DIR$/vendor/psr/container" /> |
||||
<path value="$PROJECT_DIR$/vendor/maennchen/zipstream-php" /> |
||||
<path value="$PROJECT_DIR$/vendor/firebase/php-jwt" /> |
||||
</include_path> |
||||
</component> |
||||
<component name="PhpProjectSharedConfiguration" php_language_level="7.1" /> |
||||
</project> |
@ -0,0 +1,107 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<module type="WEB_MODULE" version="4"> |
||||
<component name="NewModuleRootManager"> |
||||
<content url="file://$MODULE_DIR$"> |
||||
<sourceFolder url="file://$MODULE_DIR$/app" isTestSource="false" packagePrefix="app\" /> |
||||
<sourceFolder url="file://$MODULE_DIR$/crmeb" isTestSource="false" packagePrefix="crmeb\" /> |
||||
<sourceFolder url="file://$MODULE_DIR$/extend" isTestSource="false" /> |
||||
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" /> |
||||
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/fastknife/ajcaptcha" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alipaysdk/easysdk" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/godruoyi/php-snowflake" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/danielstjules/stringy" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/mtdowling/jmespath.php" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/grpc/grpc" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/cache" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/lexer" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/overtrue/wechat" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/annotations" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/qcloud_sts/qcloud-sts-sdk" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/overtrue/socialite" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/qcloud/cos-sdk-v5" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpoffice/phpspreadsheet" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/volcengine/volc-sdk-php" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/psr7" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/promises" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/guzzle" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/markbaker/matrix" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/markbaker/complex" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/qiniu/php-sdk" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/xaboy/form-builder" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/xin/container" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/xin/helper" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/league/flysystem" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/league/mime-type-detection" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/myclabs/php-enum" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/topthink/think-queue" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/iot-20180120" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/topthink/think-view" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/dysmsapi-20170525" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/translation-contracts" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/topthink/think-helper" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/darabonba-openapi" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-mbstring" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/topthink/think-migration" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/endpoint-util" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/translation" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/topthink/think-factory" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/tea-utils" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/var-dumper" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/topthink/think-captcha" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/credentials" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php72" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/topthink/think-filesystem" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/gateway-spi" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/psr-http-message-bridge" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/topthink/framework" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/linkvisual-20180120" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-normalizer" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/topthink/think-orm" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/tea-fileform" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/topthink/think-template" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/tea-xml" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-idn" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/topthink/think-image" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/openapi-util" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzle/guzzle" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-foundation" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/topthink/think-multi-app" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/tea" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/process" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/dh2y/think-qrcode" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/pimple/pimple" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/intervention/image" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/spatie/macroable" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/google/longrunning" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/lizhichao/one-sm" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/google/gax" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/lizhichao/word" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/google/protobuf" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/google/grpc-gcp" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/aws/aws-sdk-php" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/google/auth" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/google/common-protos" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/ralouphie/getallheaders" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/adbario/php-dot-notation" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/songshenzong/support" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/workerman/crontab" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/workerman/channel" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/aliyuncs/oss-sdk-php" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/monolog/monolog" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/workerman/workerman" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-message" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/simple-cache" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/nesbot/carbon" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/log" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/cache" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/container" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/maennchen/zipstream-php" /> |
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/firebase/php-jwt" /> |
||||
</content> |
||||
<orderEntry type="inheritedJdk" /> |
||||
<orderEntry type="sourceFolder" forTests="false" /> |
||||
</component> |
||||
</module> |
@ -0,0 +1,6 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project version="4"> |
||||
<component name="VcsDirectoryMappings"> |
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" /> |
||||
</component> |
||||
</project> |
@ -0,0 +1,14 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project version="4"> |
||||
<component name="WebServers"> |
||||
<option name="servers"> |
||||
<webServer id="709c973a-72c9-4cea-8f44-88c7e1729ea5" name="1" url="http://47.103.53.180"> |
||||
<fileTransfer host="47.103.53.180" port="21"> |
||||
<advancedOptions> |
||||
<advancedOptions dataProtectionLevel="Private" passiveMode="true" shareSSLContext="true" /> |
||||
</advancedOptions> |
||||
</fileTransfer> |
||||
</webServer> |
||||
</option> |
||||
</component> |
||||
</project> |
@ -0,0 +1,144 @@ |
||||
<?php |
||||
// +---------------------------------------------------------------------- |
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ] |
||||
// +---------------------------------------------------------------------- |
||||
// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved. |
||||
// +---------------------------------------------------------------------- |
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 |
||||
// +---------------------------------------------------------------------- |
||||
// | Author: CRMEB Team <admin@crmeb.com> |
||||
// +---------------------------------------------------------------------- |
||||
|
||||
namespace app\model\activity\advance; |
||||
|
||||
use app\model\product\product\StoreDescription; |
||||
use app\model\product\product\StoreProduct; |
||||
use crmeb\basic\BaseModel; |
||||
use crmeb\traits\ModelTrait; |
||||
use think\Model; |
||||
|
||||
/** |
||||
* TODO 预售商品Model |
||||
* Class StoreSeckill |
||||
* @package app\model\activity |
||||
*/ |
||||
class Student extends BaseModel |
||||
{ |
||||
/** |
||||
* 数据表主键 |
||||
* @var string |
||||
*/ |
||||
protected $pk = 'id'; |
||||
|
||||
/** |
||||
* 模型名称 |
||||
* @var string |
||||
*/ |
||||
protected $name = 'student'; |
||||
|
||||
use ModelTrait; |
||||
|
||||
/** |
||||
* 一对一关联 |
||||
* 商品关联商品商品详情 |
||||
* @return \think\model\relation\HasOne |
||||
*/ |
||||
public function description() |
||||
{ |
||||
return $this->hasOne(StoreDescription::class, 'product_id', 'id')->where('type', 6)->bind(['description']); |
||||
} |
||||
|
||||
/** |
||||
* 一对一关联 |
||||
* 商品关联商品商品详情 |
||||
* @return \think\model\relation\HasOne |
||||
*/ |
||||
public function product() |
||||
{ |
||||
return $this->hasOne(StoreProduct::class, 'id', 'product_id')->where('is_show', 1)->where('is_del', 0)->field(['id', 'cate_id'])->bind([ |
||||
'cate_id' => 'cate_id' |
||||
]); |
||||
} |
||||
|
||||
/** |
||||
* 添加时间获取器 |
||||
* @param $value |
||||
* @return false|string |
||||
*/ |
||||
protected function getAddTimeAttr($value) |
||||
{ |
||||
if ($value) return date('Y-m-d H:i:s', (int)$value); |
||||
return ''; |
||||
} |
||||
|
||||
/** |
||||
* 图片获取器 |
||||
* @param $value |
||||
* @return array|mixed |
||||
*/ |
||||
protected function getImagesAttr($value) |
||||
{ |
||||
return json_decode($value, true) ?: []; |
||||
} |
||||
|
||||
/** |
||||
* 秒杀商品名称搜索器 |
||||
* @param Model $query |
||||
* @param $value |
||||
* @param $query |
||||
*/ |
||||
public function searchTitleAttr($query, $value) |
||||
{ |
||||
if ($value !== '') $query->where('title|id', 'like', '%' . $value . '%'); |
||||
} |
||||
|
||||
/** |
||||
* 是否删除搜索器 |
||||
* @param Model $query |
||||
* @param $value |
||||
* @param $data |
||||
*/ |
||||
public function searchIsDelAttr($query, $value, $data) |
||||
{ |
||||
$query->where('is_del', $value ?? 0); |
||||
} |
||||
|
||||
/** |
||||
* 状态搜索器 |
||||
* @param Model $query |
||||
* @param $value |
||||
* @param $data |
||||
*/ |
||||
public function searchStatusAttr($query, $value, $data) |
||||
{ |
||||
if ($value !== '') $query->where('status', $value); |
||||
} |
||||
|
||||
/** |
||||
* 状态搜索器 |
||||
* @param Model $query |
||||
* @param $value |
||||
* @param $data |
||||
*/ |
||||
public function searchTypeAttr($query, $value, $data) |
||||
{ |
||||
if ($value !== '') $query->where('type', $value); |
||||
} |
||||
|
||||
/** |
||||
* 商品ID搜索器 |
||||
* @param Model $query |
||||
* @param $value |
||||
* @param $data |
||||
*/ |
||||
public function searchProductIdAttr($query, $value, $data) |
||||
{ |
||||
if ($value) { |
||||
if (is_array($value)) { |
||||
$query->whereIn('product_id', $value); |
||||
} else { |
||||
$query->where('product_id', $value); |
||||
} |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue