64], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'cx_mch_id' => '平台商户ID', 'order_no' => '订单号', 'content' => '回调数据', 'created_at' => '添加时间', 'is_delete' => '是否删除:0=否,1=是', 'deleted_at' => '删除时间', ]; } public function beforeSave($insert) { if(parent::beforeSave($insert)){ if($this->isNewRecord){ $this->created_at = time(); } if($this->is_delete == 1) $this->deleted_at = time(); return true; } else { return false; } } public static function logger($order_no, $content, $cx_mch_id = 0) { $model = new PayNotifyLog(); $model->cx_mch_id = $cx_mch_id; $model->order_no = $order_no; $model->content = is_string($content) ? $content : json_encode($content, JSON_UNESCAPED_UNICODE); if(!$model->save()){ return (new Model())->getModelError($model); } return Model::asReturnSuccess(); } }