init: 项目初始代码
This commit is contained in:
27
app/index/model/Product.php
Normal file
27
app/index/model/Product.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\index\model;
|
||||
|
||||
/**
|
||||
* @mixin \think\Model
|
||||
*/
|
||||
class Product extends BaseModel
|
||||
{
|
||||
/**
|
||||
* @param $languageId
|
||||
* @param $data
|
||||
* @return array|string[]
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getProductBanner($languageId,$data):array
|
||||
{
|
||||
$space = AdvertiseSpace::where('name',$data)->select()->toArray();
|
||||
if (!empty($space)) {
|
||||
return $this->getBanner($languageId,$space[0]['id']);
|
||||
}
|
||||
return ['image' => ''];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user