'ID', 'main_order_id' => 'Main Order ID', 'insurance_order_id' => 'Insurance Order ID', 'create_time' => 'Create Time', ]; } /** * ���ݶ����Ų�ѯ��ʿ�����Ƿ�������� * @param $order_id * @return array */ public function getOneInfo($order_id) { try { $result = self::find() ->from(self::tableName()) ->where([ 'OR', ['=', 'MAIN_ORDER_ID', $order_id], ['=', 'INSURANCE_ORDER_ID', $order_id] ])->asArray()->all(); } catch (Exception $e) { $result = null; } return $result; } /** * Des:添加新记录 * Name: addOne * @param $insuranceDate * @return int * @author 倪宗锋 */ public function addOne($insuranceDate) { $values = [ 'create_time' => date('Y-m-d H:i:s'), 'main_order_id' => $insuranceDate['main_order_id'], 'insurance_order_id' => $insuranceDate['insurance_order_id'], ]; $this->attributes = $values; $res = $this->insert(); if ($res == false) { return 0; } return $this->id; } /** * Function Description:根据主订单id 查出关联的保险id * Function Name: GetInsuranceOrderId * @param $order_main_id * * @return array|ActiveRecord[] * * @author 娄梦宁 */ public function GetInsuranceOrderId($order_main_id) { $result=self::find()->select('insurance_order_id') ->from(self::tableName()) ->where(['main_order_id'=>$order_main_id]) ->asArray() ->all(); return $result; } }