审查视图

model/folderSql.php 817 字节
1  
邓超 authored
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<?php

namespace Model;

/**
 * 文件夹
 * @author:dc
 * @time 2023/2/17 18:04
 * Class folderSql
 * @package Model
 */
class folderSql {

    public static $table = 'folders';
1  
邓超 authored
16 17 18 19 20 21 22 23
    /**
     * 所有文件夹
     * @param int $email_id
     * @return string
     * @author:dc
     * @time 2023/2/18 9:22
     */
    public static function all(int $email_id):string {
1  
邓超 authored
24
        return "select `folder`,`pid`,`origin_folder`,`last_sync_time`,`folder` from `".static::$table."` where `email_id` = {$email_id} order by `id` asc";
1  
邓超 authored
25
    }
1  
邓超 authored
26 27

1  
邓超 authored
28 29 30 31 32 33 34 35 36 37 38
    /**
     * 是否存在,存在则返回 id
     * @param $where
     * @return string
     * @author:dc
     * @time 2023/2/18 11:48
     */
    public static function has($where){
        return "select `id` from `".self::$table."` where ".dbWhere($where);
    }
1  
邓超 authored
39 40 41 42



}