request->post(); $str = $post['ids'] ?? ''; $auth = $post['auth'] ?? 0; $ids = json_decode($str, true); if (empty($ids)) { util::fail('请选择花材20'); } PtItemClass::updateByIds($ids, ['auth' => $auth]); $relate = PtCpItemClass::getAllByCondition(['itemId' => ['in', $ids]], null, '*', null, true); if (!empty($relate)) { foreach ($relate as $rel) { $rel->auth = $auth; $rel->save(); } } util::complete('操作成功'); } }