123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <?php
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- namespace app\admin\logic\kefu;
-
- use app\common\model\kefu\KefuLang;
-
-
- class KefuLangLogic
- {
-
-
-
- public static function lists(int $limit,int $page)
- {
- $list = KefuLang::where(['shop_id' => 0])->order('sort asc')->paginate([
- 'list_rows' => $limit,
- 'page' => $page,
- ]);
- return ['count' => $list->total(), 'lists' => $list->getCollection()];
- }
-
-
-
-
- public static function add(array $post)
- {
- $kefu_lang = new KefuLang();
- $kefu_lang->title = $post['title'];
- $kefu_lang->content = $post['content'];
- $kefu_lang->sort = $post['sort'];
- return $kefu_lang->save();
- }
-
-
-
- public static function edit(array $post){
- return KefuLang::update($post);
- }
-
-
-
-
- public static function detail(int $id){
- return KefuLang::where(['id'=>$id])->find();
- }
-
-
-
- public static function del(int $id){
- return KefuLang::destroy($id);
- }
- }
|