From f1fad67f76e9e561b7575d3c347fb7a65435d300 Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Mon, 20 Apr 2026 15:33:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A6=99=E6=B8=AF=E6=BE=B3?= =?UTF-8?q?=E9=97=A8=E5=8F=B0=E6=B9=BE=E5=BF=AB=E9=80=92=E5=AE=9A=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/controller/PromotionFactory.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/application/api/controller/PromotionFactory.php b/application/api/controller/PromotionFactory.php index 2c39b8e..adb4ca9 100644 --- a/application/api/controller/PromotionFactory.php +++ b/application/api/controller/PromotionFactory.php @@ -3,6 +3,7 @@ namespace app\api\controller; use think\Db; +use think\Validate; class PromotionFactory extends Base { @@ -132,6 +133,23 @@ class PromotionFactory extends Base return jsonSuccess(['promotion_factory_id' => $id]); } + public function getCountForPromotionEmailIds(){ + $data = $this->request->post(); + $rule = new Validate([ + "ids"=>"require" + ]); + if(!$rule->check($data)){ + return jsonError($rule->getError()); + } + $ids = explode(",",$data["ids"]); + $emails = Db::name("journal_email")->whereIn("j_email_id",$ids)->select(); + $count = 0; + foreach ($emails as $item){ + $count += $item["daily_limit"]; + } + return jsonSuccess(['limit_count'=>$count]); + } + /** * 编辑工厂 */