1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?php
-
-
- namespace app\admin\model;
-
- use think\Db;
- use think\Model;
-
-
- class Single extends Model
- {
-
- protected function initialize()
- {
-
- parent::initialize();
- }
-
-
-
- public function afterSave($aid, $post, $opt)
- {
- $post['aid'] = $aid;
- $addonFieldExt = !empty($post['addonFieldExt']) ? $post['addonFieldExt'] : array();
- model('Field')->dealChannelPostData(6, $post, $addonFieldExt);
- }
-
-
-
- public function afterDel($typeidArr = array())
- {
- if (is_string($typeidArr)) {
- $typeidArr = explode(',', $typeidArr);
- }
-
-
- Db::name('archives')->where(
- array(
- 'typeid'=>array('IN', $typeidArr)
- )
- )
- ->delete();
-
- Db::name('single_content')->where(
- array(
- 'typeid'=>array('IN', $typeidArr)
- )
- )
- ->delete();
-
- \think\Cache::clear("arctype");
- extra_cache('admin_all_menu', NULL);
- }
- }
|