user_id = $user_id; $records->zone_goods_id = $z_g_id; $records->price = $price; $records->text_data = serialize($data); $records->actual_price = $actual_price; $records->residue_amount = $residue_amount; $records->create_time = date("Y-m-d H:i:s",time()); $records->save(); return $records->id; } /** * 完成订单 * @param $zone_goods_id * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public static function endOrder($c_r_id) { $zoneOrder = ConsumptionRecords::find($c_r_id); $zoneOrder->status = 1; $zoneOrder->complete_time = date("Y-m-d H:i:s",time()); $zoneOrder->save(); } }