ShopgoodsModel.php
1022 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/11/12
* Time: 17:32
*/
namespace api\index\model;
use think\Model;
class ShopgoodsModel extends Model
{
public function getContentAttr($value){
return cmf_replace_content_file_url(htmlspecialchars_decode($value));;
}
public function getThumbnailAttr($value){
return cmf_get_image_preview_url($value);
}
public function getImagesAttr($value){
if(!empty($value)){
$data = explode(',',$value);
foreach($data as $key => $vo){
$data[$key] = cmf_get_image_url($vo);
}
return $data;
}
}
public function selectData($where){
$data = $this
->where($where)
->field('id,shoptype_id,goods_name,price')
->order('id desc')
->select();
return $data;
}
public function findData($where){
$data = $this->where($where)->find();
return $data;
}
}