You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

89 line
2.1 KiB

  1. <?php
  2. namespace backend\modules\api\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "order_refund_lvmama".
  6. *
  7. * @property integer $id
  8. * @property integer $yet
  9. * @property string $lvmama_id
  10. * @property string $status
  11. * @property string $create_time
  12. * @property string $update_time
  13. * @property integer $approve_status
  14. * @property integer $payment_status
  15. */
  16. class OrderRefundLvmama extends \yii\db\ActiveRecord
  17. {
  18. /**
  19. * @inheritdoc
  20. */
  21. public static function tableName()
  22. {
  23. return 'order_refund_lvmama';
  24. }
  25. /**
  26. * @inheritdoc
  27. */
  28. public function rules()
  29. {
  30. return [
  31. [['yet', 'approve_status', 'payment_status'], 'integer'],
  32. [['create_time', 'update_time'], 'safe'],
  33. [['lvmama_id', 'status'], 'string', 'max' => 11],
  34. ];
  35. }
  36. /**
  37. * @inheritdoc
  38. */
  39. public function attributeLabels()
  40. {
  41. return [
  42. 'id' => 'ID',
  43. 'yet' => 'Yet',
  44. 'lvmama_id' => 'Lvmama ID',
  45. 'status' => 'Status',
  46. 'create_time' => 'Create Time',
  47. 'update_time' => 'Update Time',
  48. 'approve_status' => 'Approve Status',
  49. 'payment_status' => 'Payment Status',
  50. ];
  51. }
  52. /**
  53. * Function Description:接收驴妈妈退票数据插入数据库
  54. * Function Name: istRefund
  55. * @param $order_id
  56. * @param $status
  57. * @param $approve_status
  58. * @param $payment_status
  59. *
  60. * @return bool
  61. *
  62. * @author 娄梦宁
  63. */
  64. public function istRefund($order_id,$status,$approve_status,$payment_status){
  65. $transaction=Yii::$app->db->beginTransaction();
  66. $value=[
  67. 'lvmama_id'=>$order_id,
  68. 'status'=>$status,
  69. 'approve_status'=>$approve_status,
  70. 'payment_status'=>$payment_status,
  71. 'create_time'=>date('Y-m-d H:i:s')
  72. ];
  73. $this->attributes=$value;
  74. $res=$this->insert();
  75. if(!$res){
  76. $transaction->rollBack();
  77. return false;
  78. }
  79. $transaction->commit();
  80. return true;
  81. }
  82. }