quanwei
2025-11-01 121b714d710cf3c865f4a1b5efe81abec11056d1
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
<?php
 
namespace app\common\model\plus\business;
 
use app\common\model\BaseModel;
 
/**
 * 名片模板
 */
class Template extends BaseModel
{
    protected $name='business_card_template';
    protected $pk='template_id';
    public function getList($param=[]){
        $paramL=array_merge(['listRows'=>15],$param);
        $where=[];
        return $this->order('create_time','desc')->where($where)->paginate($paramL);
    }
    public function add($data){
        $data['app_id']=self::$app_id;
        return $this->save($data);
    }
 
    /**
     * 获取模板详情
     * @param $template_id
     * @return array|false|\PDOStatement|string|Template
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function detail($template_id)
    {
        return $this->where(['template_id'=>$template_id])->find();
    }
}