<?php declare (strict_types = 1); namespace app\txx\model; use think\Exception;use think\Model; /** * @mixin \think\Model */ class ActGood extends Model { // static function ActAdd(array $Good, string $actCode,array $userinfo=[]){ if (empty($Good)) throw new Exception("参与活动商品不能为空",1006); self::startTrans(); $data=[]; foreach ($Good as $item ){ $temp=[ "actCode"=>$actCode, "yz_good_id"=>$item['id'], ]; } } }