cash instanceof Cash) { $this->addError($attribute, 'cash必须是app\\models\Cash的对象'); } }] ]; } public function __construct(array $config = []) { parent::__construct($config); } public function afterTransfer() { if(!$this->validate()){ return $this->getModelError(); } //账户余额变动 $scene_cn = Balance::getBalanceScene($this->cash->scene); $desc = "{$scene_cn}提现"; $order_type = UniqueOrderNo::getOrderTypeByOrderNo($this->cash->order_no); $ext = ""; $res = Balance::logger($this->cash->user_id, Balance::TYPE_PAY, $this->cash->money, $desc, $order_type, $this->cash->order_no, $this->cash->scene, $ext, $this->cash->cx_mch_id); if($res['code'] != 0){ $err_msg = "---XDEBUG--> CASH_ID:{$this->cash->id} ERR_MSG:{$res['msg']}"; \Yii::error($err_msg); } return Model::asReturnSuccess(); } }