$name, 'code' => $code, 'created_at' => Times::getNowDateTime(), ]; try { Db::beginTransaction(); $resModel = $this->addItem($insert); if(!$resModel) throw new ModelException('添加失败'); $appid_key = $resModel->id . $resModel->name . $resModel->code; $resModel->appid = Tools::getMd5($appid_key); $resModel->secret = Tools::generateRandStr(32); $res = $resModel->save(); if(!$res) throw new ModelException('添加appid失败'); Db::commit(); }catch (\Exception $e) { Db::rollBack(); throw $e; } return $resModel; } //@@给平台下发用户信息 static function userTransactionNotifyToPlatform($user_transaction_id) { } }