function admin_lot() { $this->_check_cms(); if (!empty($_POST['job'])) { if (empty($_POST['ids'])) { Swoole_js::js_alert('没有选中操作的对象!'); exit; } switch ($_POST['job']) { case 'push': $set['tagid'] = (int) $_POST['push']; $get['in'] = array('id', implode(',', $_POST['ids'])); $model = createModel($this->app); $model->sets($set, $get); break; case 'cate': $cid = (int) $_POST['cate']; $cate = getCategory($cid); $set['cid'] = $cid; $set['cname'] = $cate['name']; $set['fid'] = $cate['fid']; $fcate = getCategory($cate['fid']); $set['fname'] = $fcate['name']; $get['in'] = array('id', implode(',', $_POST['ids'])); $model = createModel($this->app); $model->sets($set, $get); break; default: break; } Swoole_js::js_parent_reload('操作成功!'); } }
function handle_entity_op($config) { if (!isset($config['model'])) { die('参数错误!'); } $_model = createModel($config['model']); if ($_POST['job'] == 'push') { $digg = (int) $_POST['push']; $set['digest'] = $digg; $get['in'] = array('id', implode(',', $_POST['ids'])); $_model->sets($set, $get); Swoole_js::js_parent_reload('推荐成功'); } }