public function actionCode($seoUrl) { $userId = Auth::getUser()['id']; //echo $seoUrl; $packets = PaymentModel::model()->findAll(); $discount = ReferalsModel::model()->where(" code = '" . $seoUrl . "'")->findRow(); $currencies = CurrencyModel::model()->findRow(); $this->view("Code", array("discount" => $discount->discount, "packets" => $packets, "code" => $seoUrl, "currency" => $currencies), false); }
function code_delete() { $code = $_POST['code']; echo 'code = ' . $code; ReferalsModel::model()->where("`code`='{$code}'")->delete(); }