## 基本查詢
查詢一個數據使用:
~~~
model('customers')->one(['nickname'=>$q])->id;
~~~
>[info]one 方法查詢結果不存在,返回空
查詢數據集使用:
~~~
model('stores')->all(['uid'=>$user->id,'is_delete'=>0]);
~~~
>[info]all 方法查詢結果不存在,返回空數組
## 助手函數
系統提供了一個db助手函數,可以更方便的查詢:
查詢一條數據使用:
~~~
db()->table('industry')->where('slug=? ',[$data['slug']])->one();
~~~
查詢數據集使用:
~~~
db()->table('stores_users_info')->where('stores_id=? and stores_role_id in ('.DB::in($e).')',$in)->all();
~~~