|
@@ -2,11 +2,33 @@
|
|
|
|
|
|
|
|
namespace pt\controllers;
|
|
namespace pt\controllers;
|
|
|
|
|
|
|
|
-use common\components\stringUtil;
|
|
|
|
|
|
|
+use biz\cp\classes\PtCpItemClass;
|
|
|
|
|
+use biz\item\classes\PtItemClass;
|
|
|
use Yii;
|
|
use Yii;
|
|
|
use common\components\util;
|
|
use common\components\util;
|
|
|
|
|
|
|
|
class PtItemController extends BaseController
|
|
class PtItemController extends BaseController
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
|
|
+ //批量认证和取消认证
|
|
|
|
|
+ public function actionBatchAuth()
|
|
|
|
|
+ {
|
|
|
|
|
+ $post = Yii::$app->request->post();
|
|
|
|
|
+ $str = $post['ids'] ?? '';
|
|
|
|
|
+ $auth = $post['auth'] ?? 0;
|
|
|
|
|
+ $ids = json_decode($str, true);
|
|
|
|
|
+ if (empty($ids)) {
|
|
|
|
|
+ util::fail('请选择花材');
|
|
|
|
|
+ }
|
|
|
|
|
+ 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('操作成功');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|