12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
-
- namespace app\admin\model;
-
- use think\Db;
- use think\Model;
-
- class Form extends Model
- {
- public $admin_lang = 'cn';
-
-
- protected function initialize()
- {
-
- parent::initialize();
- $this->admin_lang = get_admin_lang();
- }
-
-
- public function GetFormListCount($form_ids = [])
- {
-
- $where = [
- 'typeid' => ['IN', $form_ids],
- 'form_type' => 1,
- 'lang' => $this->admin_lang,
- ];
-
-
- $form_list_count = Db::name('guestbook')
- ->field('typeid as form_id, count(aid) AS count')
- ->where($where)
- ->group('form_id')
- ->getAllWithIndex('form_id');
-
-
- return $form_list_count;
- }
-
-
-
- public function afterDel($aidArr = array())
- {
- if (is_string($aidArr)) {
- $aidArr = explode(',', $aidArr);
- }
-
-
- Db::name('guestbook_attr')->where([
- 'aid' => ['IN', $aidArr]
- ])->delete();
- }
- }
|