1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- /**
- * Created by PhpStorm.
- * User: shensong
- * Date: 2021/2/4
- * Time: 15:00
- */
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- class OrderEditRecordsDetail extends Model
- {
- #订单批量记录与订单关系表
- protected $table = 'order_edit_records_detail';
- public $timestamps = false;
- public static function addData($data, $editId)
- {
- $insert = [];
- foreach($data as $val) {
- $item = [];
- $item['edit_id'] = $editId;
- $item['order_id'] = $val['order_id'];
- $item['final_amount'] = $val['final_amount'];
- $item['original_final_amount'] = $val['original_final_amount'];
- $item['original_actual_consumption_after'] = $val['original_actual_consumption_after'];
- $item['actual_consumption_after'] = $val['actual_consumption_after'];
- $item['original_top_fee_after'] = $val['original_top_fee_after'];
- $item['top_fee_after'] = $val['top_fee_after'];
- $item['original_link_fee_after'] = $val['original_link_fee_after'];
- $item['link_fee_after'] = $val['link_fee_after'];
- $item['original_flow_boost_back_point_after'] = $val['original_flow_boost_back_point_after'];
- $item['flow_boost_back_point_after'] = $val['flow_boost_back_point_after'];
- $item['enable'] = 1;
- $insert[] = $item;
- }
- return self::insert($insert);
- }
- public static function getAllOrder($editId)
- {
- $list = self::where('edit_id', $editId)->where('enable', 1)->get();
- $list = json_decode(json_encode($list), 1);
- return $list;
- }
- }
|